Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Export to Excel
Message
From
20/10/2005 16:51:03
 
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:
01060870
Views:
14
>>>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.


I tried with comma first and the Excel didn't recognise it :o)) So I changed to ";" and all worked. I don't know why Excel gets delimiters from Regional stting when the file is CommaSepparatedValues?
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform