I am using a csv file that I am iterating over each line and make each column a different title.
for i in csvreader:
1 = i[0]
2 = i[1]
etc.
however the 2 column has spaces after the text in the column ‘text ‘. I need to removed the spaces after the text. I need ‘text’, with no spaces at the end.
I know I could just remove it from the CSV in excel, but I need to do this with Python I am not wanting to open CSV file and work with it.
I have tried to replace and strip, but I can’t get this to work. Any suggestions?
Use
strip()(orlstrip()orrstrip()):