Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delimited file with headers
Message
De
30/10/2002 11:41:08
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/10/2002 11:06:04
Billy Bramhall
Interdirect Usa, Inc.
Houston, Texas, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00716883
Message ID:
00716925
Vues:
14
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform