ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I open a csv file and not have leading zeros eliminated (https://www.excelbanter.com/excel-discussion-misc-queries/101201-how-do-i-open-csv-file-not-have-leading-zeros-eliminated.html)

AS400_EXCEL_John_B

How do I open a csv file and not have leading zeros eliminated
 
I have a File that I down Load from another system (AS400) which I converted
to CSV Format. Some of the Alphanumeric fields (cells) have legimitate
values that start with 0 (zeros).
When I open the file in EXCEL it strips the leading zeros from those fields.
How do I prevent that.?

I tried using " as a delimiter but it did not work.

Ron Coderre

How do I open a csv file and not have leading zeros eliminated
 
Try this:

Change the file extention to .TXT (from .CSV)

When you open the file, the Text Import Wizard will engage.
On Step_3, select your column and set it for TEXT

That will prevent Excel from changing it to numeric values.

Does that help?
***********
Regards,
Ron

XL2002, WinXP


"AS400_EXCEL_John_B" wrote:

I have a File that I down Load from another system (AS400) which I converted
to CSV Format. Some of the Alphanumeric fields (cells) have legimitate
values that start with 0 (zeros).
When I open the file in EXCEL it strips the leading zeros from those fields.
How do I prevent that.?

I tried using " as a delimiter but it did not work.


Tom Hutchins

How do I open a csv file and not have leading zeros eliminated
 
Change the extension of your data file from .CSV to .TXT

This will cause the Text Import wizard to launch. On step 2 of the wizard,
check Comma for the delimiter. On step 3, select the field with the leading
zeros, then click Text. When you finish importing the data, that field will
still have the leading zeros.

Hope this helps,

Hutch

"AS400_EXCEL_John_B" wrote:

I have a File that I down Load from another system (AS400) which I converted
to CSV Format. Some of the Alphanumeric fields (cells) have legimitate
values that start with 0 (zeros).
When I open the file in EXCEL it strips the leading zeros from those fields.
How do I prevent that.?

I tried using " as a delimiter but it did not work.



All times are GMT +1. The time now is 07:25 PM.

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