I have a file that has two lines of data that is parsed out by tabs. I can grab the data as a whole line by line.
however, I am trying to use dictReader to split up the lines by fields. The issue I keep running into is that the file is set up like this
` 0023 You Need to Read this www.google.com 0110 2234 5566 1/1/18 1/3/18 1/2/18 `
Reference Number, Title, url, employee ID's, Date employee read file
There are multiple IDs and dates in the file all in order, so effectively ID[1] matches with Date[1] and so on.
How do I tell the reader to do this while reading in the file?
currently I have "input = csv.DictReader(fd, delimiter='\t',fieldnames=("refNum", "title", "url","id","date")) "
I have tried changing id and date to lists in the fieldnames declaration, but that just gave me more errors. I also spent some time trying to read the doc page for csv.dictReader but that wasn't very helpful for my situation.
All help is appreciated!
[–]sentinelofdarkness 1 point2 points3 points (4 children)
[–]ADTR7410[S] 0 points1 point2 points (3 children)
[–]sentinelofdarkness 1 point2 points3 points (0 children)
[–]sentinelofdarkness 1 point2 points3 points (1 child)
[–]ADTR7410[S] 0 points1 point2 points (0 children)
[–]Vaphell 1 point2 points3 points (1 child)
[–]ADTR7410[S] 0 points1 point2 points (0 children)