Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delimited file with headers
Message
From
30/10/2002 11:41:08
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
30/10/2002 11:06:04
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00716883
Message ID:
00716925
Views:
13
This message has been marked as the solution to the initial question of the thread.
>Hi Yuri,
>
>Thank you for your response.
>
>(Note: I'm using Visual FoxPro 5.0)
>
>I tried the syntax you suggested;
>
>< copy to testfile CSV >
>
>but, I recieved the following error:
>
>"Command contains unrecognized phrase/keyword"
>
>Do you think this is a VFP version conflict or am I missing something?
>
>Thanks,
>Billy

Billy,
VFP5 doesn't support type CSV. Workaround :
copy to myFile.csv type delimited
lcStr=''
for ix=1 to fcount()
 lcStr= lcStr+iif(empty(lcStr),'',',')+field(ix)
endfor

handle=fopen('myFile.csv',12)
lnSize  = fseek(handle,0,2)
=fseek(handle,0,0)
lcContent=fread(handle,lnSize)
=fseek(handle,0,0)
=fputs(handle,lcStr,len(lcStr))
=fwrite(handle,lcContent,lnSize)
=fclose(handle)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform