On 17/01/22 4:18 am, Mats Wichmann wrote:
the convention for Excel, which is usually the reason
people are using csv, is you can enclose the entire comma-containing
field in "quote marks" (afaik it must be double-quote).
And to include a double quote in a field, quote the field and
double the d
On 1/15/22 13:56, Mahmood Naderan via Python-list wrote:
> Hi,
> I use the following line to write some information to a CSV file which is
> comma delimited.
>
> f = open(output_file, 'w', newline='')
> wr = csv.writer(f)
> ...
> f.write(str(n) + "," + str(key) + "\n" )
>
>
> Problem is that ke
list
Sent: Sat, Jan 15, 2022 3:56 pm
Subject: Writing a string with comma in one column of CSV file
Hi,
I use the following line to write some information to a CSV file which is comma
delimited.
f = open(output_file, 'w', newline='')
wr = csv.writer(f)
...
f.write(str(n) + &
Right. I was also able to put all columns in a string and then use writerow().
Thanks.
Regards,
Mahmood
On Saturday, January 15, 2022, 10:33:08 PM GMT+1, alister via Python-list
wrote:
On Sat, 15 Jan 2022 20:56:22 + (UTC), Mahmood Naderan wrote:
> Hi,
> I use the following lin
On Sat, 15 Jan 2022 20:56:22 + (UTC), Mahmood Naderan wrote:
> Hi,
> I use the following line to write some information to a CSV file which
> is comma delimited.
>
> f = open(output_file, 'w', newline='')
> wr = csv.writer(f)
> ...
> f.write(str(n) + "," + str(key) + "\n" )
>
>
> Problem is
On 16/01/2022 09.56, Mahmood Naderan via Python-list wrote:
> Hi,
> I use the following line to write some information to a CSV file which is
> comma delimited.
>
> f = open(output_file, 'w', newline='')
> wr = csv.writer(f)
> ...
> f.write(str(n) + "," + str(key) + "\n" )
>
>
> Problem is that
Hi,
I use the following line to write some information to a CSV file which is comma
delimited.
f = open(output_file, 'w', newline='')
wr = csv.writer(f)
...
f.write(str(n) + "," + str(key) + "\n" )
Problem is that key is a string which may contain ',' and this causes the final
CSV file to have