comma in csv

User avatar
sal21
PlatinumLounger
Posts: 4339
Joined: 26 Apr 2010, 17:36

comma in csv

Post by sal21 »

Big problem...
i need to use a csv with comma delimited.
but....

in one or more value, have a comma in string!!!!
similar:

...,price_title,...
...,145,55,....

User avatar
HansV
Administrator
Posts: 78378
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: comma in csv

Post by HansV »

If you want comma as delimiter, you should either enclose such values in quotes: "145,55", or use a point as decimal separator: 145.55.
Alternatively, use semi-colon instead of comma to separate the values: ...;145,55;...
Best wishes,
Hans

User avatar
Doc.AElstein
BronzeLounger
Posts: 1499
Joined: 28 Feb 2015, 13:11
Location: Hof, Bayern, Germany

Re: comma in csv

Post by Doc.AElstein »

I get a lot of problems with , ; . in text files. If at all possible I would use some character as the separator that is unlikely to ever be in any of your data.
The pipe, | , is often used. It looks nice and pretty as a separator as well because it looks like a dividing wall
I am having difficulty logging in with this account just now.
You can find me at DocAElstein also

User avatar
sal21
PlatinumLounger
Posts: 4339
Joined: 26 Apr 2010, 17:36

Re: comma in csv

Post by sal21 »

HansV wrote:
08 Feb 2021, 11:24
If you want comma as delimiter, you should either enclose such values in quotes: "145,55", or use a point as decimal separator: 145.55.
Alternatively, use semi-colon instead of comma to separate the values: ...;145,55;...
no.
required only comma delimited.

if the value is incapsulated in Myvar (as string), how to "145,55"

peraphs:

Myvar=""145,55"" (with double quote, or not?)

User avatar
HansV
Administrator
Posts: 78378
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: comma in csv

Post by HansV »

Myvar = """145,55"""

or

Myvar = Chr(34) & "145,55" & Chr(34)
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4339
Joined: 26 Apr 2010, 17:36

Re: comma in csv

Post by sal21 »

HansV wrote:
08 Feb 2021, 13:02
Myvar = """145,55"""

or

Myvar = Chr(34) & "145,55" & Chr(34)
reolved with chr! tks

but similar problem with:

dim COLB AS STRING

COLB = "a:1:{i:0;s:8:"customer";}"

when i import, Excel consider two value!!!

a:1:{i:0 and s:8:"customer";}

i have used also a chr(34) for Chr(34) & COLB & Chr(34)

but why i use a comma delimited and not ;

User avatar
HansV
Administrator
Posts: 78378
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: comma in csv

Post by HansV »

It might be because your system settings use ; as list separator.
Best wishes,
Hans