file = open(a.txt, 'r') logfile = open(b.txt, 'w') searchstrings = ('Name1','Name2') for line in file.readlines(): for word in searchstrings: if word in line: logfile.writelines(line) file.close()
i am not able to convert the text file in to csv file can you please suggest a way or how to do it how to go forward
my text file looks like this
i want them to display in a file as name1 name 2 values etc in csv file
i tried till this but not able to acheive it
MOD EDIT: Added code tags.