For Programmers: Free Programming Magazines  


Home > Archive > Clipper > January 2005 > DBF to Text File









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author DBF to Text File
julian1984@yahoo.com

2005-01-26, 8:55 am

I have a dbf file

Name Salary
AAA 100
BBB 110

How to convert dbf to txt file with I want the result like this :
AAA;100
BBB;110

Regards,

Julian

Stephen Quinn

2005-01-26, 8:55 am

Julian

You can add the error checking and change STR() to whatever else you want to use

FCreate( 'op.txt' )
nHandle := FOpen( 'op.txt' )

x->( DBGoTop() )
DO WHILE ! x->( EOF() )
FWrite( nHandle, x->NAME + ';' + LTrim( STR( x->Salary ) ) + CRLF )
x->( DBSkip() )
ENDDO
FClose( nHandle )

--
HTH
Steve


Stephan Koenig

2005-01-26, 8:55 am


> AAA;100
> BBB;110


Make sure the Name does not include a ";".



tom knauf

2005-01-26, 8:55 am

Hi,

have a look for the "COPY TO" command.

HTH
Tom

<julian1984@yahoo.com> schrieb im Newsbeitrag
news:1106701093.746521.79540@f14g2000cwb.googlegroups.com...
> I have a dbf file
>
> Name Salary
> AAA 100
> BBB 110
>
> How to convert dbf to txt file with I want the result like this :
> AAA;100
> BBB;110
>
> Regards,
>
> Julian
>



Ray Marron

2005-01-26, 3:55 pm

[quotes rearranged]

"tom knauf" <tom.knauf@itds.de> wrote in message
news:ct7prv$bb2$02$1@news.t-online.com...
> <julian1984@yahoo.com> schrieb im Newsbeitrag
> news:1106701093.746521.79540@f14g2000cwb.googlegroups.com...
>
> Hi,
>
> have a look for the "COPY TO" command.


Unfortunately, COPY TO only supports comma delimited files. The misleading
"DELIMITED WITH" option really lets you select the "text qualifier"
(Microsoft's term for it in CSV files) and affects how character fields are
enquoted.

For example, COPY TO "foo" DELIMITED WITH ";" would create this:

;AAA;,100
;BBB;,110

--
Ray Marron


tom knauf

2005-01-27, 8:55 am

Hi,

sorry I had my VFP in mind
Tom

"tom knauf" <tom.knauf@itds.de> schrieb im Newsbeitrag
news:ct7prv$bb2$02$1@news.t-online.com...
> Hi,
>
> have a look for the "COPY TO" command.
>
> HTH
> Tom
>
> <julian1984@yahoo.com> schrieb im Newsbeitrag
> news:1106701093.746521.79540@f14g2000cwb.googlegroups.com...
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com