Thread
:
On File open - how to stop conversion of postcodes to numbers
View Single Post
#
2
Posted to microsoft.public.excel.worksheet.functions
David Biddulph[_2_]
external usenet poster
Posts: 8,651
On File open - how to stop conversion of postcodes to numbers
Yes. Rename the file from .csv to .txt. When you open the txt from within
Excel, the text import wizard will allow you to select the format of each
individual column, so you can select text for your postcodes.
Unfortunately importing from a file named .csv bypasses the wizard, so you
get Excel's default options.
--
David Biddulph
"DragonRider from Downunder" <DragonRider from
wrote in message
...
I have a CSV file I download regularly which on open within Excel converts
all numeric fields to numbers - when I do not want it to do so.
e.g. Postcodes can be "00037" appear as 37 which is not a valid US
postcode
for printing to labels etc. As postcodes in Australia for example are
only 4
digits I can not just replace the missing leading zeros by string
manipulation - as I do not know how many there should be. perhaps some
countries have 6 numbers in the postcode? I know UK have mix of numbers
and
letters so they are OK as they appear as text.
When I open CSV file using Notepad the field contains "00037" so it is all
there in the Raw state of the file.
Surely there must be a way to open (without using complex open text file
or
stream and complex record structures) a CSV file and control the bahaviour
to
forbid it changing the field contents (ie. opening it as straight text or
ascii equivalent)?
Reply With Quote
David Biddulph[_2_]
View Public Profile
Find all posts by David Biddulph[_2_]