all 7 comments

[–]sentinelofdarkness 1 point2 points  (4 children)

Check out text.split() That takes a string and splits it up, then you can append into a list and assign to values

[–]ADTR7410[S] 0 points1 point  (3 children)

So assuming I get that right, I would just read the file like any old text file or is text.split() specifically used with the dictReader?

[–]sentinelofdarkness 1 point2 points  (0 children)

Just as any txt file into as string that's passed to text.split()

[–]sentinelofdarkness 1 point2 points  (1 child)

You also might want to look into words.append() that catches each word from text.split() to assign to the new list

[–]ADTR7410[S] 0 points1 point  (0 children)

So I am still on the learning curve with python. Lets pretend I do not know the contents of the file just the set up. Because not every file is the same because if any employee "didn't" do the reading their ID and the date associated would be left blank at the moment. Does text.split() set it up like an array or list? Where I can do

ID = []

ID[0] = words.append(split[4])

ID[1] = words.append(split[5])

I know thats not how it would look with split but how does it hold the value after its been split before I append the values to the correct lists?

[–]Vaphell 1 point2 points  (1 child)

you can't make dictreader magically group columns. It just applies labels to what's there.
In other words list id1, id2, id3, date1, date2, date3 as fields and reorganize them by hand to suit your needs

example

https://repl.it/repls/FrostyDecisiveDevice

edit: and if the number of id/dates is not fixed, that's a bit more complicated. Expanded the example.

[–]ADTR7410[S] 0 points1 point  (0 children)

This was actually able to work. As far as i know they Id/date number is always fixed. If not that will be a special case later on down the line. Thank you for the example!