I want to read a CSV file\'s columns directly into variables. The result should be something like you would get with the following shell line: while IFS=, read ColumnName1
Thank you all for working with my question. Here is what I ended up doing. Simple, but it worked. Again, problem was to read a headless CSV into variables so that I could "do stuff"
import sys
for record in sys.stdin.readlines():
record = record.rstrip()
ColumnName1, ColumnName2, ColumnName2 = record.split(',')
This does the same thing as the shell code I posted in the question:
while IFS=, read ColumnName1 ColumnName2 ColumnName3
do stuff
Thanks for all the help. I will be asking more questions soon!!