The reason quotes are needed in CSV is because some brain surgeon long ago decided that commas aren't human characters and that they should become value delimiters. Thus, CSV elements containing commas need the surrounding quotes.
 
We MV people are thankful that our delimiters are far away from the human characters, 254 etc. Early MS basic allowed INPUT A,B and your answer contained a comma and their INPUT put it into the 2 variables. If your single answer to INPUT A was "Perth,SW", you got an 'extra ignored'  and lost the SW.
 
It's a shame that we must live within the poor judgement of these early designs. But they're out there.
 
I have 2 utilities that i use extensively when building CSV's (rows & columns) from within Databasic when export/importing to a PC system. The first is called LINE.CSV and it converts LINE<1>, LINE<2> LINE<3> (a built variable representing one row) into a CSV row for appending to your eventual text file (OPENSEQ or emulator export). I have its opposite called CSV.LINE which will convert an invoming CSV row into LINE<1> etc paying attention to the commas. If anyone would like a copy email me off line. I'm probably going to publish them in Spectrum anyway.
 
BTW, to answer the second question, to remove the pennies from an ICONV'd value you would use MD03. That's Zero Three , not Oh. The Zero indicates the displayed decimals and the 3 is the converted. Thus, MD3 is the same as MD33.
 
Also, check to see if the comma contained in a number offends the numerical format of that cell. I don't think the comma contained is numeric, ie PRINT NUM("123,456") returns false and PRINT NUM(123,456) implies a second argument to the NUM function. you can't say X=123,456 and if you put quotes around it, it's not numeric.
 
my 1 cent.
----- Original Message -----
Sent: Tuesday, February 03, 2004 12:45 AM
Subject: RE: using commas in a csv file output

OK, I now get    10,000.00    but I would like to suppress the decimal places.
 
This is my line of code :
FLAT.LINE:='"':OCONV(PARTS.REC<8,W>,"MD3,"):'"'
 
Any further advise, most appreciated.
 

Cheers, Simon.
Australia.

-----Original Message-----
From: Kevin King [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 3 February 2004 15:51
To: U2 Users Discussion List
Subject: RE: using commas in a csv file output

quote the entire data value.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Simon Adams
Sent: Monday, February 02, 2004 9:44 PM
To: [EMAIL PROTECTED]
Subject: using commas in a csv file output

How can I force a comma in an outputted csv file ?
 
I want to put commas in numbers  eg:  10,000  but as the delimiter is a comma, it puts 10 in one column and then the 000 in the next column.
How can I OCONV the output but keeping the number together ?

Cheers, Simon.
Australia.

 


*************************************************************************************
This e-mail, including any attachments to it, may contain confidential and/or personal information.
If you have received this e-mail in error, you must not copy, distribute, or disclose it, use or take any action
based on the information contained within it.

Please notify the sender immediately by return e-mail of the error and then delete the original e-mail.

The information contained within this e-mail may be solely the opinion of the sender and may not necessarily
reflect the position, beliefs or opinions of Salmat on any issue.

This email has been swept for the presence of computer viruses known to Salmat's anti-virus systems.

For more information, visit our website at www.salmat.com.au.
*************************************************************************************


_______________________________________________
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users
_______________________________________________
u2-users mailing list
[EMAIL PROTECTED]
http://www.oliver.com/mailman/listinfo/u2-users

Reply via email to