I suspect you can't fix it. CSV (Comma separated variables) in its
purest form is an ASCII file, a flat file database in which each line
is a record, and data fields are separated by the comma character. If
Excel natively stores the number without leading zeros, and the
leading zeros are provided for display only by formatting the cell,
then you will lose the formatting when you save the file as a CSV
file.
If you get yourself a good programmer's editor with a good macro
capability (The Semware Editor, perhaps), then writing a macro to
process the CSV file to run the zip code field and insert leading
zeros on any zip code that is less than five characters is a simple
process.
One thing you might try is to format the column (cells in the column)
with the zip code as "text" or even use the leading apostrophe, and
then see what happens when you save the file in CSV format. It should
save the file properly if it follows the logic of text cells and CSV.
But having done that, you might have to manually re-insert the leading
zeros in the Excel file. Try two copies of the worksheet. Copy from
the column in one sheet that is displaying zip codes properly. Format
the column in the destination sheet as text first and then
paste-special, values into that column. In principle that should
work.
Fred Holmes
On Tue, 25 Jan 2005 10:51:04 -0800, "RodFCIS"
wrote:
This was one of the first things I tried, but it doesn't work. The .csv
format doex not retain this information.
"gennario" wrote:
Try puitting an apostrophe ' before you type the zip code. this should leave
the 0 as leading.
"RodFCIS" wrote:
I'm using Excel 2003. I need to create an importable shipping address file
for our UPS shipping system so we can import all the information at once
without typing all 200 addresses by hand. The file to be imported must be
saved in a .csv (comma separated value) format. Many of the zip codes in this
file having leading zeros (New England areas). When I save the .xls file as a
.csv file, the .csv file does not show and/or retain the leading zeros. The
result is that the imported file has a bunch of 4 digit zip codes that get
rejected by UPS and have to be painstakingly hand-corrected.
I have tried virtually every cell format available that makes any sense (and
some no sense!). NOTHING seems to work.
HELP!
|