0

Format is like:

CHINA;2002-06-25 00:00:00.000;5,60
CHINA;2002-06-26 00:00:00.000;5,32
CHINA;2002-06-27 00:00:00.000;5,31

and I try to use Python's CSV tools to parse it but cannot understand the paragraph, source:

And while the module doesn’t directly support parsing strings, it can easily be done:

import csv
for row in csv.reader(['one,two,three']):
    print row

Could someone clarify the line ['one,two,three']? How would you use it with format A;B;C?

1 Answer 1

3

The docs you quote are talking about the difference between parsing csv data stored in a file, and csv data stored in a string. It doesn't have to do with the format of the data.

You should be able to read your data with something like:

import csv
csv_reader = csv.reader(open('data.csv', 'rb'), delimiter=';')
for row in csv_reader:
    # do something with row....
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.