Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Numeric values as character in CSV

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,389
Default Numeric values as character in CSV

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.

"GKW in GA" wrote in message
...
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.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Numeric values as character in CSV

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.

"Fred Smith" wrote:

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.

"GKW in GA" wrote in message
...
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.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Numeric values as character in CSV

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

On Thu, 22 May 2008 16:58:00 -0700, GKW in GA
wrote:

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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I convert numeric value to its character value ex. 10=Ten Shreesh Asthana Excel Worksheet Functions 1 April 25th 08 09:16 AM
PICTURE RECOGNITION AS A ALPHA-NUMERIC CHARACTER Greg Wilson Excel Worksheet Functions 0 March 28th 07 01:56 AM
PICTURE RECOGNITION AS A ALPHA-NUMERIC CHARACTER Greg Wilson Excel Worksheet Functions 0 March 28th 07 12:15 AM
Return Numeric Labels that have different Numeric Values Sam via OfficeKB.com Excel Worksheet Functions 8 December 3rd 06 02:06 AM
show character value of a month rather than numeric? jim sturtz New Users to Excel 4 January 17th 06 08:40 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"