I am trying to import a text file with the following sintax:

APPEND FROM file.txt DELIMITED WITH CHARACTER |

I have VFP with SYSFORMATS ON, witch is the same configuration of the
txt file (point=',' and separator='.').

When I append the file with this command, he imports the numbers
greater the 999 wrong, as they have a dot(.) as group digit. For
example, the number 12.498 will be imported as 12 (small number like
653 is imported as 653). With this command it imports de decimal fields
correctly, for example, 0,9 is imported as 0,9 correctly.

When I use the import wizard for text files, it now imports the
thousands correctly but loses the decimal numbers, for the example
above, we would see something like this: filed 1:12.498; field 2:653;
field 3:0,0.

Can anyone help me? I would like to do it programatically, since i will
have to import several files several times.

Thanks,
Guga



--
gmendes
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Re: APPEND FROM does not work as Import wizard by Cindy

Cindy
Wed Feb 08 13:05:50 CST 2006

Hi Guga,

The simplest thing is to create a cursor with character fields first,
followed by numeric fields. When you Append all the numbers will become
characters. After you Append fill in the numbers the way you want. Probably
something like:

Replace nField With Val(ChrTran(cField, ".", ""))

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


"gmendes" <gmendes.22x14p@mail.codecomments.com> wrote in message
news:gmendes.22x14p@mail.codecomments.com...
>
> I am trying to import a text file with the following sintax:
>
> APPEND FROM file.txt DELIMITED WITH CHARACTER |
>
> I have VFP with SYSFORMATS ON, witch is the same configuration of the
> txt file (point=',' and separator='.').
>
> When I append the file with this command, he imports the numbers
> greater the 999 wrong, as they have a dot(.) as group digit. For
> example, the number 12.498 will be imported as 12 (small number like
> 653 is imported as 653). With this command it imports de decimal fields
> correctly, for example, 0,9 is imported as 0,9 correctly.
>
> When I use the import wizard for text files, it now imports the
> thousands correctly but loses the decimal numbers, for the example
> above, we would see something like this: filed 1:12.498; field 2:653;
> field 3:0,0.