Aleks Roth Aleks Roth - 9 days ago
164 0

Hello.
i keep getting this error with my code:not enough values to unpack (expected 6, got 5)
i have looked through my code and can't seem to find the problem

Python

not enough values to unpack (expected 6, got 5)

"""
Created on Fri May  15 14:38:28 2017

"""

import re
import csv
import sys 


 
print(sys.stdout.encoding)
# file input
fi=open('input.csv', 'r', encoding='UTF-8')
# file output
fo=open('output_data.csv', 'w',encoding='UTF-8')
 
SEPARATOR = ";"
 
SBS_ROUTE1=[]
ID1=[]
ASSIGNMENT_NAME1=[]
TER1=[]
INFO1=[]
SHABLON1=[]
 
 
 
for line in fi:
    [SBS_ROUTE,ID,ASSIGNMENT_NAME,TER,INFO,SHABLON]=line.split(SEPARATOR)
    clearText = re.sub(r"[!/():\-,.\"\+]",' ', INFO.upper()
                     

    )
 
 
   
    print(clearText)
 
   
    
i=0
for x1 in INFO1:
    fo.write(str(SBS_ROUTE1[i])+";"+str(ID1[i])+";"+str(ASSIGNMENT_NAME1[i])+";"+str(TER1[i])+";"+str(INFO1[i])+";"+str(SHABLON1[i])+"\n")
    i=i+1
fo.close()
fi.close()