ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Cell format on reading .csv file (https://www.excelbanter.com/excel-discussion-misc-queries/237430-cell-format-reading-csv-file.html)

sdawson

Cell format on reading .csv file
 
I have a .csv file where fields may have value "01234".

When I read this file into Excel, I want the cell to be formatted as text
(so the 0 is retained). By default Excel formats as numeric and loses the 0.

There is an alternative where I can rename the file as .txt and use the
wizard, but I want to see if there is a simpler alternative.

I have tried prefixing the field with "'" character, but that resyults in
the value "101234" in the cell.

Any ideas?

Jacob Skaria

Cell format on reading .csv file
 
You dont need to rename the file instead in 2007 from menu DataFrom Text and
in 2003 from menu DataImport External DataImport Data select the .csv file
to be opened and then follow ..the Wizard.

If this post helps click Yes
---------------
Jacob Skaria


"sdawson" wrote:

I have a .csv file where fields may have value "01234".

When I read this file into Excel, I want the cell to be formatted as text
(so the 0 is retained). By default Excel formats as numeric and loses the 0.

There is an alternative where I can rename the file as .txt and use the
wizard, but I want to see if there is a simpler alternative.

I have tried prefixing the field with "'" character, but that resyults in
the value "101234" in the cell.

Any ideas?


sdawson

Cell format on reading .csv file
 
Thanks Jacob - just found that one as well; but is there nothng I can do to
the field in the csv to make Excel automatically interpret as text?

If I type directly into the cell, I can force Excel to intepret as text by
prefixing with "'". I was hoping for something similar I can use fo the file.

"Jacob Skaria" wrote:

You dont need to rename the file instead in 2007 from menu DataFrom Text and
in 2003 from menu DataImport External DataImport Data select the .csv file
to be opened and then follow ..the Wizard.

If this post helps click Yes
---------------
Jacob Skaria


"sdawson" wrote:

I have a .csv file where fields may have value "01234".

When I read this file into Excel, I want the cell to be formatted as text
(so the 0 is retained). By default Excel formats as numeric and loses the 0.

There is an alternative where I can rename the file as .txt and use the
wizard, but I want to see if there is a simpler alternative.

I have tried prefixing the field with "'" character, but that resyults in
the value "101234" in the cell.

Any ideas?


Jacob Skaria

Cell format on reading .csv file
 
Sorry, you will need to use the wizard anyway.

If this post helps click Yes
---------------
Jacob Skaria


"sdawson" wrote:

Thanks Jacob - just found that one as well; but is there nothng I can do to
the field in the csv to make Excel automatically interpret as text?

If I type directly into the cell, I can force Excel to intepret as text by
prefixing with "'". I was hoping for something similar I can use fo the file.

"Jacob Skaria" wrote:

You dont need to rename the file instead in 2007 from menu DataFrom Text and
in 2003 from menu DataImport External DataImport Data select the .csv file
to be opened and then follow ..the Wizard.

If this post helps click Yes
---------------
Jacob Skaria


"sdawson" wrote:

I have a .csv file where fields may have value "01234".

When I read this file into Excel, I want the cell to be formatted as text
(so the 0 is retained). By default Excel formats as numeric and loses the 0.

There is an alternative where I can rename the file as .txt and use the
wizard, but I want to see if there is a simpler alternative.

I have tried prefixing the field with "'" character, but that resyults in
the value "101234" in the cell.

Any ideas?



All times are GMT +1. The time now is 06:28 AM.

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