leading zero & .csv files

  • Thread starter Thread starter klafert
  • Start date Start date
K

klafert

I have an exported .csv file which one of the fields has leading zero. I
know that when I open the file the zero disappear. I have to open the file
to edit another field with the correct info. When I do this I lose the
leading zero, because I have to re-import this file. It can only be imported
as a .csv file. I know how to use format - style - custom - click on the
zero - add the correct number of zero. I get the right number 001 instead of
1. I had saved the csv as a .xls made the charges using the format - style -
etc. Then I saved it as .csv and didn't open the file and tried to import
and got the error. I open the file with notepad and it show correctly. I
tried to manually edit the file in notepad but this didn't help. Actually I
was using search and replace in note pad. How can I make the leading zero
stays? And yes I have to open the file to correct a different field after I
have exported the file to .csv.
 
Hi

A possible option for you would be to change the file extension of the
file from .csv to .txt once it has been saved down, and then open it
up in Excel - you will get the TextImport wizard activating with which
you can specify that the fields should be opened up as Text (ie so no
dropping of the leading zeros). Perform all the required corrections
in the file, then save it down as a csv again.

Best regards

Richard
 
An alternative is to open the CSV using Data/ Import External Data, rather
than with File/ Open or double-clicking the file.
The Data import route again invokes the wizard to allow the columns to be
specfied as text.
--
David Biddulph

Hi

A possible option for you would be to change the file extension of the
file from .csv to .txt once it has been saved down, and then open it
up in Excel - you will get the TextImport wizard activating with which
you can specify that the fields should be opened up as Text (ie so no
dropping of the leading zeros). Perform all the required corrections
in the file, then save it down as a csv again.

Best regards

Richard
 
Thanks so much and I should have thought of that. I am using notepad for
some of the conversions but didn't think of that. I will give it a try.
 
Thanks so much - hopefully you made my week work much easier so I can play
with my grandson.!!!
 
Back
Top