cindy_winegarden
Fri Dec 02 14:41:01 CST 2005
Hi Tom,
Please be very careful of numbers that are displayed with commas if you are
using a comma-delimited file. It's best to "clean up" the spreadsheet before
importing, unless it's something that you will do over and over. In that
case, have the person who makes the XLS do it with only the simplest
formatting.
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com
Blog:
http://spaces.msn.com/members/cindywinegarden
"Tom" wrote:
> Andrew, after trying some of the options i have found the same, the Import
> from is a nasty joke and very frustrating. i had not thought of creating a
> cursor after saving to a .txt. the text file will allow me to set it up the
> way i need to.
>
> im going to give that a try.
>
> thanks to all for you advice !!
>
> Tom
>
> "Andrew Howell" wrote:
>
> > "Tom" <Tom@discussions.microsoft.com> wrote in message
> > news:F0DEEB67-9BC4-47C7-81AA-01D9956EA963@microsoft.com...
> > >i have been presented a sheet that contains information i need to impot
> > >into
> > > a dbf.
> > > i have no clue hoe to do it and keep the data straight in the table.
> > >
> > > append from? import from? this is something i have never done. should i
> > > save
> > > it to an sdf or txt first then bring it in to the table?
> >
> > My personal opinion is that you experience fewest problems by saving to a
> > text file (eg tab delimited,) then creating a cursor in Fox with the desired
> > data types and widths for the Excel columns; eg:
> >
> > CREATE CURSOR impdata ( ;
> > field1 C(40), ;
> > field2 N(10,2), ;
> > field3 D, ;
> > field4 L)
> >
> > and finally use APPEND FROM <textfile> DELIMITED WITH TAB
> >
> > The seemingly quicker "save as DBF from Excel" or "import XLS from Foxpro"
> > have often caused me a headache and a lot more work by creating data types I
> > didn't want (numbers in character fields, broken dates etc.) and stupid
> > widths.
> >
> > Excel is nasty for saving valid DBFs (it has created illegal and duplicate
> > field names for me with stunning ease in the past) and when importing XLS
> > with FPW2.6, all fields will be character data. I expect that last point has
> > been addressed in later versions of Fox but for a small amount of work in
> > going the text way I always get exactly what I want.
> >
> > --
> > Regards
> > Andrew Howell
> >
> >
> >