r/pythonhelp • u/KeganBergi • Dec 08 '21
PYTHON ASSIGNMENT PLS SOMEONE LOL
Read in the included data file and write it to a file named sorted_data.txt with the same data, but order the columns in ascending alphabetical order.
https://www.dropbox.com/s/snhowdtcne6zuuf/MOCK_DATA-3.txt?dl=0
That is the link to the data file that is supposed to be initially read in.
1
Upvotes
1
u/KeganBergi Dec 08 '21
The example is perfect, I know how to read in the file of mock data with... file open("MOCK-DATA3.txt") along with sorting the data, but obviously, it does work but it sorts literally everything in alphabetical order, I just need to index the first row being the header, with the... data[0:] command which then pinpoints where each of the first words for the header, the assignment states I need a "was is" list. In that sense I get that I need to keep the old data and copy it to a new list to work from.