Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export to Excel
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Miscellaneous
Thread ID:
01060842
Message ID:
01060866
Views:
10
>>Is there a way to Copy or Export a table to Excel without including the field names in the first row? I can go in an remove the row thru OLE, but was wondering if there's a simpler way.
>>
>>TIA for your help -
>>Margaret
>
>Try this:
>
>CREATE CURSOR cTest (Fld1 C(10), Fld2 N(10))
>FOR asd = 1 TO 10
>    INSERT INTO cTest VALUES (TRANSFORM(asd),asd)
>NEXT
>COPY TO test.csv DELIMITED WITH CHARACTER ";"
>
>Excel will opened CSV file w/o field names

That does export the data without the field names, but Excel does not recognize the separate fields in the string. If a do an addional sequence as follows:

x = filetostr('text.csv')
x = strtran(x,'";"','","')
y = strtofile(x,'text.csv')

then the file is legible to Excel again. Of course - one must be careful about the character chosen for the delimiter to ensure that data is not misinterpreted for the export and strtran.

Thanks much for your help.
Margaret Duddy
mmd@outformations.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform