Want to convert txt file to csv file using Python? Use the below python script to convert txt file to csv file.
text1 = r"textfile.txt"
csv1 = r"csvfile.csv"
inputtxt = csv.reader(open(text1, "rb"), delimiter = '\t')
outputcsv = csv.writer(open(csv1, 'wb'))
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.