You should use the csv
module:
import csv
reader = csv.reader(['1997,Ford,E350,"Super, luxurious truck"'], skipinitialspace=True)
for r in reader:
print r
output:
['1997', 'Ford', 'E350', 'Super, luxurious truck']
More Related Contents:
- sort csv by column
- Simple CSV to XML Conversion – Python
- Parsing a pipe-delimited file in Python
- create a loop inside a loop in python
- How to insert a space delimited text file into mysql using Python? [closed]
- How do I parse a string to a float or int?
- Extracting an attribute value with beautifulsoup
- How to use Stanford Parser in NLTK using Python
- Writing a pandas DataFrame to CSV file
- How to write to a CSV line by line?
- How to make separator in pandas read_csv more flexible wrt whitespace, for irregular separators?
- Equation parsing in Python
- Python/Json:Expecting property name enclosed in double quotes
- Extracting a URL in Python
- sscanf in Python
- Save results to csv file with Python
- Using numpy.genfromtxt to read a csv file with strings containing commas
- Split string on commas but ignore commas within double-quotes?
- Read CSV file with comma within fields in Python
- How to keep leading zeros in a column when reading CSV with Pandas?
- Writing Python lists to columns in csv
- Reading rows from a CSV file in Python
- Math Expression Evaluation
- CSV new-line character seen in unquoted field error
- Read CSV into a dataFrame with varying row lengths using Pandas
- How do you replace all the occurrences of a certain character in a string?
- Easiest way to read csv files with multiprocessing in Pandas
- json reading error json.decoder.JSONDecodeError: Invalid \escape
- pandas read csv with extra commas in column
- Python: Writing Nested Dictionary to CSV