leading zero & .csv files

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.
 
R

RichardSchollar

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
 
D

David Biddulph

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
 
K

klafert

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.
 
K

klafert

Thanks so much - hopefully you made my week work much easier so I can play
with my grandson.!!!
 

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

Similar Threads


Top