In the interest of fairness, the comments about brain surgeons and poor
judgement (in this case) are mis-directed.

First Excel can easily import TAB delimited data.  Go to menu > Data >
Import External Data > Import data, then use the wizard to specify the
delimiter is a tab and not a comma.  That process can easily be made into a
macro.

Second, the issue with commas and decimals can't be attributed to Excel vs
MV.  Excel processes and formats (renders) data.  By passing pre-formatted
data into the Excel you blur the line between business rules and
user-interface, something that OO developers will tell you is a big no-no
because it causes exactly the problems you experience here.  The proper way
to put numbers into Excel is to forget about all of the MV formatting and
just import unformated data, then assign formatting to cells, columns, and
rows as required.

Third, related to the last note in any case, by wrapping text in quotes you
are telling Excel that a piece of data is Text and not numeric.  This may
cause problems later if you try to do calculations or reformat the data as
though it were numeric.

There are many ways to automate processes like this.  People tend to look at
every Excel import function like a nail because the only tool they know
about is the CSV hammer.  Excel is a powerful tool and you should look
beyond comma delimited text files for your import/export needs - or at least
learn how to properly swing that hammer.

Oops, 3 cents there.
Tony
Nebula R&D


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Mark Johnson
Sent: Monday, February 02, 2004 10:19 PM
To: U2 Users Discussion List
Subject: Re: using commas in a csv file output


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 ----- 
From: Simon Adams 
To: U2 Users Discussion List 
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]
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