My_output_file.write("double()\n".format(len(text_list), 2)) With open(txt_file, "w") as my_output_file: With open(csv_file, "r") as my_input_file: Txt_file = input('Enter the name of your output file: ') csv_file = input('Enter the name of your input file: ') csv files, I have hundreds of lines of data like the bellow: Print("I/O error()\n".I want to convert a couple of. # A simple program to create a formatted text file from a *.csv file.Ĭsv_file = input('Enter the name of your input file: ') ![]() Now, to be fair, I am new to Python, and this script works perfectly (first try), I would just like some feedback on my methods, or ways to improve my quality of code. This file is an input to another program, and rather than spending the time to copy and paste the excel sheet into notepad and crop out all the commas and make sure there are spaces and such I decided to write a python script that would do it for me. ![]() To a regular *.txt file with the structure: #1ĭouble filename(number of columns, number of columns) At my job, often I have to manually convert *.csv Files structured like: number,number\n
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |