Why doesn't Microsoft Excel conform to csv standards when it opensa file from Explorer?

G

goldberg(XBXBXBX)

Hi Newsgroup Users,

I'm using Excel 2002 as that is what work has and isn't planning on
upgrading any time soon.

I've scanned the various Excel forums about csv files and being able to
open csv directly and trying to keep formatting and other considerations.

My understanding is that a CSV is that, a COMMA separated variable file.
Data elements are separated by commas but strings/literals should
indicate that commas within are not separators but part of the data.

For example, if I have a data record that looks like:

12345,678,901,090012345

I would expect Excel to handle this as four separate numeric values,
i.e. 12345 then 678 then 901 then 90012345

If that same record was written, based on what I've read about CSV file
formats, as

"12345,678,901",090012345

I'd now expect to see two values. One as the STRING 12345,678,901 and
the second a number as 90012345.

and if I passed

"12345,678,901","090012345"

I would expect to see two STRINGS the first STRING 12345,678,901 and the
second as a string 090012345.

Unfortunately, Excel takes the last string and converts it as two
numeric values and changes the first STRING to 12,345,678,901 and the
second drops the leading zero, even if the preceeding line looks like
"XXXXXXXXXXXXXXXX","XXXXXXXXXX" to try to "trick" the converter into
thinking that the data is two strings and to continue parsing as such.

I have a situation where I distribute data extracts as reports to select
users and want them to just open the attachment directly from the email
they receive.

This, unfortunately, doesn't work as expected and I have to add
"non-numeric" characters to the strings as, once the parser sees a
non-digit character, it then seems to behave as I'd want. For example,
that last line of "12345,678,901","090012345" becomes
"12345,678,901 KEY","090012345 KEY2"
and then the import treats them as two strings, unfortunately, with
"extra" data.

If you reply, please send it to the "adjusted" email address without the
(XBXBXBX) thanks.

Regards
Randy G.
Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top