Import/export with leading zero
Bruce Easton
bruce at stn.com
Mon Feb 11 12:36:58 PST 2008
Jay R. Ashworth wrote Monday, February 11, 2008 2:59 PM:
>
> On Mon, Feb 11, 2008 at 01:33:42PM -0500, Bruce Easton wrote:
> > > When viewed with a text editor, the field is quoted "03001" but
> > > when opened, Excel drops the leading zero.
> > >
> > > Any suggestions as to what I am doing wrong?
> >
> > Richard - format the Excel column for that field to type text (and
> > alignment right if desired) prior to opening your file to load
> > into the spreadsheet.
>
> In my response, which I think I dropped off-list, I missed the
> direction of move: of course, it's excel configuration. If you're just
> trying to drop a CSV file, though, Richard, and open it raw with Excel,
> you are going to have some trouble.
>
> Is there a trick to force Excel to guess right for that column?
>
> Cheers,
> -- jra
> --
> Jay R. Ashworth Baylink
Oops - what I wrote above doesn't work as I had suspected. That link
that Walter gave shows some methods to get around the problem.
One method that I saw in a nearby link that does seem to work as a
standard procedure for the person doing the importing into Excel is:
1. Rename the .csv file to .txt (don't save it as txt, but just rename it).
2. Open Excel, open a New spreadsheet.
3. From the menu, do Data - Get External Data - Import Text File,
and select your text file.
4. Then in the Wizard, select Delimited,
then Next, then check the Comma box,
then Next, then highlight the column(s) where you want to preserve
leading zeros
and click the Text radio button for 'Column data format'
5. Click Finish and then the default to bring into the existing
worksheet.
Does anyone know if you can pre-format the csv file in some way to
make it so the (frequently) remote person doing the importing doesn't
have to use one of these methods? If that was in that info on the
link that Walter supplied, I must have missed it.
Bruce
Bruce Easton
STN, Inc.
More information about the Filepro-list
mailing list