Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> 'abc,foo,bar'.split(',')
- ['abc', 'foo', 'bar']
- In: 'abc,"a string, with a comma","another, one"'
- Out: ['abc', 'a string, with a comma', 'another, one']
- import csv
- input = ['abc,"a string, with a comma","another, one"']
- parser = csv.reader(input)
- for fields in parser:
- for i,f in enumerate(fields):
- print i,f # in Python 3 and up, print is a function; use: print(i,f)
Add Comment
Please, Sign In to add comment