I have a CSV File with a list of file names with no file extension. I have all the names as strings and would like to add a string .JPG to each line.
Here is what I have so far:
#Adding .JPG string to the end of each line for the Part Numbers
string_to_add = ".JPG"
#Open the file and join the .JPG to the current lines
with open("PartNums.csv", 'r') as f:
file_lines = [#Adding String goes here]
#Writes to the file until its done
with open("PartNums.csv", 'w') as f:
f.writelines(file_lines)
I think I need to use the .join function however I am not sure how to.
This is what the CSV file looks like now:
filename
filename
filename
filename
filename
filename
The output I am looking for is:
filename.JPG
filename.JPG
filename.JPG
filename.JPG
filename.JPG
filename.JPG
I appreciate all and any help given, Thank you.