Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying to a Delimited File - Getting Rid of Quote Marks
Message
 
To
26/05/1999 04:15:12
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00222810
Message ID:
00222815
Views:
33
>>I am trying to copy a dbf to the equivalent of a .csv file (comma separated). If I use the VFP command:
>>
>>COPY TO file DELIMITED WITH CHAR ,
>>
>>It will separate the field with commas but it also puts quotation marks around the character fields (apparently because commas may be in the text). I don't want to send that. I want strict comma delimited.
>>
>>Any suggestions???
>>
>>Thanks always everyone for the advice.
>
copy to file temp.txt delimited
>handlein=fopen("temp.txt")
>handleout = fcreate("mytext.txt")
>#define MAXSIZE 65535
>* Could be whole filelength but 65535 prevents rare headaches
>do while !feof(handlein)
> =fwrite( handleout, ;
>   chrtran( fread( handlein, MAXSIZE),["],"", MAXSIZE )
>enddo
>=fclose(handlein)
>=fclose(handleout)
>erase temp.txt
Cetin

Alternatively, you can copy to textfile delimited with TAB and then read each line from the text file and change the tabs to commas.
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Reply
Map
View

Click here to load this message in the networking platform