ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   CSV leading zeroes (https://www.excelbanter.com/excel-discussion-misc-queries/2335-csv-leading-zeroes.html)

Tim_nol

CSV leading zeroes
 
I have an app that exports data as CSV. Certain fields contain leading
zeroes. When the CSV is opened in Excel the Leading Zeroes are dropped. I
do not want to have any manual intervention. Is there a way to change a
setting in Excel to treat fields with leading zeroes as text and preserve the
fields as is.

Thanks.

Peo Sjoblom

You would need either to rename it to *.txt, that will trigger the text
import wizard where you can select the import as text and keep leading zeroes
or use dataget external dataimport text file, then select *.* (all files)
and open it from there, that will also trigger the text import wizard.

Regards,

Peo Sjoblom

"Tim_nol" wrote:

I have an app that exports data as CSV. Certain fields contain leading
zeroes. When the CSV is opened in Excel the Leading Zeroes are dropped. I
do not want to have any manual intervention. Is there a way to change a
setting in Excel to treat fields with leading zeroes as text and preserve the
fields as is.

Thanks.


mixa

just append an equal sign ("=")in front of the field you want leading
zeroes preserved.


Peo Sjoblom wrote:
You would need either to rename it to *.txt, that will trigger the

text
import wizard where you can select the import as text and keep

leading zeroes
or use dataget external dataimport text file, then select *.* (all

files)
and open it from there, that will also trigger the text import

wizard.

Regards,

Peo Sjoblom

"Tim_nol" wrote:

I have an app that exports data as CSV. Certain fields contain

leading
zeroes. When the CSV is opened in Excel the Leading Zeroes are

dropped. I
do not want to have any manual intervention. Is there a way to

change a
setting in Excel to treat fields with leading zeroes as text and

preserve the
fields as is.

Thanks.




All times are GMT +1. The time now is 02:09 PM.

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