Im having trouble reading my dict in 'paReference'.
here is 123.csv:
BrandName,LineCode,PartNo,ShortDescription,SuperStock,DropshipStock,Price,Core
Carter,5C,M3643,FILTER,0,0,14.8,0
Carter,5C,M3805,FILTER,1,0,14.8,0
Carter,5C,M4512,FILTER,2,0,14.8,0
Carter,5C,M4642,FILTER,3,0,14.8,0
Carter,5C,M60088,FILTER,4,0,14.8
Carter,5C,M60142,FILTER,6,0,14.8
Carter,5C,M60167,FILTER,7,0,14.8,0
and abc.csv:
productcode,book_isbn,stockstatus,Price,Core,AddtoCartBtn_Replacement_Text,Availability
5CM2195,5CM2195,,,,,
5CM2846,5CM2846,,,,,
5CM3643,5CM3643,,,,,
5CM3805,5CM3805,,,,,
5CM4512,5CM4512,,,,,
5CM4642,5CM4642,,,,,
5CM60088,5CM60088,,,,,
5CM60142,5CM60142,,,,,
5CM60167,5CM60167,,,,,
Am I reading the csv into the paRefefence dict improperly?
c = csv.reader(open(pluginPath + "123.csv"))
d = csv.reader(open(pluginPath + "abc.csv"))
paReference ={}
for item in c:
if item[1] not in paReference:
paReference =[item[0]] = [item[1] + item[2].replace('-','')]
else:
paReference[item[1]].append(item[0])
print(item)
for item in d:
if item[0] not in paReference:
print ("Not Found! " + item[0])
else:
print ("Found! " + item[0])
Im new to python I'm having trouble understanding why it has found one part number but not the others. Any suggestions help!

paReference =[item[0]] = [item[1] + item[2].replace('-','')]is almost certainly not doing what you want. What did you want it to do?ifclause here:paReference =[item[0]] = [item[1] + item[2].replace('-','')]csv.DictReaderrather than creating your dictionary if you want to read in a key/value pair container docs.python.org/3.7/library/csv.html#csv.DictReader