Fusilli Jerry
Fusilli Jerry

Reputation: 745

Possible to specify csv delimiter for writing?

Is it possible to specify the delimiting character the csv module will use when writing a file?

For example, instead of ',' use ';' or something?

I know you can change to tab delimited by setting dialect='excel-tab, but not sure if there is an option for freely choosing the delimiter.

Thanks

Upvotes: 0

Views: 79

Answers (1)

mgilson
mgilson

Reputation: 309841

I believe you can just set the delimiter:

writer = csv.writer(csvfile,delimiter=';')

There's also an example of this in the documentation for csv.writer

Upvotes: 6

Related Questions