Data from CSV file modified on import

  • Thread starter Thread starter dwhite
  • Start date Start date
D

dwhite

We provide our clients with results in CSV format, which they can the
import into their own databases - either directly from the CSV file, o
by first opening the file in Excel. However, when some values ar
imported into Excel, they are being modified and displayed as a date.
At first I thought it was just a display formatting problem; I though
reformatting the cell in Excel to General would display the correc
number, but this is not the case.

This is one line from a CSV file:

"3","08-4284","2,2',4,4',5-Pentachlorobiphenyl","1230.0",
","19.7","ng/Kg"," "," "

The second field, "08-4284" is being interpreted as a date and i
displayed in Excel as Aug-84. When I select this cell and reformat i
as text, the value displayed is 870593 - completely different to th
original value.

I changed the file extension to txt, then used the import wizard t
format that column as General during import, but Excel is stil
formatting it as a date and modifying the value.

I don't want to add a " ' " before the text, as some clients impor
this directly from the CSV file and they would see that character a
part of the string. Is there anything I can do to stop Excel fro
trying to import these values as dates? Ideally, I'd just like exce
to import everything as plain text, without any "intelligent
reformatting.

Thanks in advance for any help

Dave Whit
 
Try doing this with a slight modification:

I changed the file extension to txt, then used the import wizard to
format that column as General during import, but Excel is still
formatting it as a date and modifying the value.

Instead of using General. Use Text.
 

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

Back
Top