ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   leading zero & .csv files (https://www.excelbanter.com/excel-discussion-misc-queries/171080-leading-zero-csv-files.html)

klafert

leading zero & .csv files
 
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.

RichardSchollar[_2_]

leading zero & .csv files
 
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


On 31 Dec, 01:28, klafert wrote:
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.



David Biddulph[_2_]

leading zero & .csv files
 
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

"RichardSchollar" wrote in message
...
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


On 31 Dec, 01:28, klafert wrote:
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.




klafert

leading zero & .csv files
 
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.

"RichardSchollar" wrote:

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


On 31 Dec, 01:28, klafert wrote:
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.




klafert

leading zero & .csv files
 
Thanks so much - hopefully you made my week work much easier so I can play
with my grandson.!!!

"David Biddulph" wrote:

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

"RichardSchollar" wrote in message
...
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


On 31 Dec, 01:28, klafert wrote:
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.






All times are GMT +1. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com