ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Automatically retain zero's when importing csv files (https://www.excelbanter.com/excel-discussion-misc-queries/124877-automatically-retain-zeros-when-importing-csv-files.html)

The Big P

Automatically retain zero's when importing csv files
 
I regularly have to extract data from various systems as csv which
automatically open in Excel. However, when this happens automatically leading
zero's are lost as Excel seems to assume that data is number and not text. I
can intervene manually and do the usual 'save as txt' or 'use import wizard
to format cells at text' etc. However, these extracts are meant to run
without any human intervantion. Does anyone know of a way of setting Excel to
always open formatted as text or a script that can be used within a csv
extract that would pre-format Excel? Here's hoping...

Bernard Liengme

Automatically retain zero's when importing csv files
 
Do you have control of the app that makes the CSV? If so then precede the
quasi-numeric fields with a single apostrophe.
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"The Big P" <The Big wrote in message
...
I regularly have to extract data from various systems as csv which
automatically open in Excel. However, when this happens automatically
leading
zero's are lost as Excel seems to assume that data is number and not text.
I
can intervene manually and do the usual 'save as txt' or 'use import
wizard
to format cells at text' etc. However, these extracts are meant to run
without any human intervantion. Does anyone know of a way of setting Excel
to
always open formatted as text or a script that can be used within a csv
extract that would pre-format Excel? Here's hoping...




The Big P

Automatically retain zero's when importing csv files
 
Bernard, Yes we have control. I will give it a try and revert. Thanks for the
advice. Peter

"Bernard Liengme" wrote:

Do you have control of the app that makes the CSV? If so then precede the
quasi-numeric fields with a single apostrophe.
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"The Big P" <The Big wrote in message
...
I regularly have to extract data from various systems as csv which
automatically open in Excel. However, when this happens automatically
leading
zero's are lost as Excel seems to assume that data is number and not text.
I
can intervene manually and do the usual 'save as txt' or 'use import
wizard
to format cells at text' etc. However, these extracts are meant to run
without any human intervantion. Does anyone know of a way of setting Excel
to
always open formatted as text or a script that can be used within a csv
extract that would pre-format Excel? Here's hoping...






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

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