Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / General Excel Questions / May 2008

Tip: Looking for answers? Try searching our database.

Numeric values as character in CSV

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
GKW in GA - 22 May 2008 23:23 GMT
Whenever I populate a numeric value into a cell, the leading zeros are always
removed even when I create a custom format. Excel thinks its a number but I
want to treate it as a character because I have to FTP the file to a
mainframe. I always get the warning that it contains some features not
compatible with CSV

Example, when I put 012345 in a cell, when I save it and then re-open it, it
contains 12345. I need it to be 012345 because the machine I am FTP'ing the
file too has this column formatted as *char 6, so I need it to end up as
'012345' not '12345 '. I can't save it as .xls because I can't FTP an .xls
file to another box and and use it in another application.
Fred Smith - 22 May 2008 23:45 GMT
You will need to convert the cell to text to get it to stay the way you want
in the CSV file.

Either use an initial apostrophe in data entry (as in '012345). This forces
the entry to stay as text.

If it's a calculated field, use something like:

=text(a1,"000000")

Again, this will create a 6-character text field.

Regards,
Fred.

> Whenever I populate a numeric value into a cell, the leading zeros are
> always
[quoted text clipped - 11 lines]
> '012345' not '12345 '. I can't save it as .xls because I can't FTP an .xls
> file to another box and and use it in another application.
GKW in GA - 23 May 2008 00:58 GMT
That doesn't work, for CSV anyway. When you save the CSV file you get the
standard prompt that says it contains features not compatible with CSV. The
choices are YES, to save it as CSV omitting the incompatible features or NO
to save it in another format besides CSV (like .xls). If you select YES, then
when you return, the leading zeros have been removed.

What you said works for .xls but not .csv. I tried it before I ever created
this post.
Maybe I have an option set wrong or something.

> You will need to convert the cell to text to get it to stay the way you want
> in the CSV file.
[quoted text clipped - 26 lines]
> > '012345' not '12345 '. I can't save it as .xls because I can't FTP an .xls
> > file to another box and and use it in another application.
Gord Dibben - 23 May 2008 02:16 GMT
Don't re-open the *.csv file in Excel.

Open it in Notepad or similar.

Your zeros will be there.

Gord Dibben  MS Excel MVP

>That doesn't work, for CSV anyway. When you save the CSV file you get the
>standard prompt that says it contains features not compatible with CSV. The
[quoted text clipped - 5 lines]
>this post.
>Maybe I have an option set wrong or something.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.