HI all
I'm reading data from a CSV (text file) with a "| " as the denominator. Every is working as planned but I'm having a problem with the last 3 lines of code. In the text Document the 'RB' (Body) has more than one entry exp.
RB | INV000111 | price to be charged
RB | INV000112 | price 2 to be charged
some has more then TWO entry. Now the problem being
When Python reads the CSV it only writes the Second line to the PDF INV000112 not both lines as it is displayed.
How can I get it to write Both lines as displayed in the text file
I'm reading data from a CSV (text file) with a "| " as the denominator. Every is working as planned but I'm having a problem with the last 3 lines of code. In the text Document the 'RB' (Body) has more than one entry exp.
RB | INV000111 | price to be charged
RB | INV000112 | price 2 to be charged
some has more then TWO entry. Now the problem being
When Python reads the CSV it only writes the Second line to the PDF INV000112 not both lines as it is displayed.
How can I get it to write Both lines as displayed in the text file
Code:
db = csv.reader(open('C:/Users/rynod/Desktop/cpc.txt','rb'), delimiter = '|', quotechar='"')
for row in db:
for field in enumerate(row):
if 'H' in field:
#Customer Details
CustPAName = row[9]
CustPA1 = row[10]
CustPA2 = row[11]
CustPA3 = row[12]
CustPA4 = row[13]
CustPA5 = row[14]
CustFAName = row[18]
CustFA1 = row[19]
CustFA2 = row[20]
CustFA3 = row[21]
CustFA4 = row[22]
CustEMail = row[15]
#Sharp Details
SharpAddress1 = row[2]
SharpAddress2 = row[3]
SharpAddress3 = row[4]
SharpAddress4 = row[5]
SharpTel = row[6]
SharpFax = row[7]
Model = row[16]
Serial = row[17]
Account = row[25]
OurRef = row[27]
[B]elif 'RB' in field:
print(row)
Decs = row[/B]
Comment