Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text File export using COPY TO w/SDF & AS extension 3

Status
Not open for further replies.

kraus

MIS
Oct 16, 2000
23
US
In the foxpro manual it says the programmer can use the command:
COPY TO filename SDF AS 0

where AS 0 would designate no code page:

'If nCodePage is 0, no code page conversion occurs and the newly created table or file is not marked with a code page.'

when i use the syntax above i get:

'invalid code page' error

please help,

thank you, matthew kraus

 
Well my friend,
VFP documentation is wrong about this issue, the most simple solution for this is to omit AS at all.
It will really help if you can be more specific about what r u trying to do, what is the format of your source
What is the format you want your target to be.
Is the internationalization issues is important to you by any how?
Thanks Walid Magd
Engwam@Hotmail.com
 
When you want to copy to another DBF.. I assume that you want to create a new DBF for some reporting purposes.. (Just a little more thinking from my side...whereas you may not have asked with the same thinking).. If my thinking is correct.. I want to give deifferent choices...

1. A report can be created to output the DBF in an easy way

REPORT FORM myForm TO FILE myFile

myFile can be "FULL-PATH\myFile" and will cast the report nicely in a text format.

2. The SELECT statement (SQL select) will create the DBF and can be stored in the harddisk with the file name you want (I dont mean a cursor). So instead of a COPT TO.. you can use SELECT * FROM sourceDBF INTO DBF myDBF

This is not to avoid the COPY TO as an alternative.. it depends on your purpose.




ramani :)
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Hi Matthew,

Its possible this is an unreported VFP bug. I was unable to locate any KB articles related to this issue. You could report it to MS Tech Support and see what they have to say.

As an alternative solution, you could use the cpzero.prg that comes with VFP to change the codepage mark of your table, then copy it to SDF, then reset the codepage mark.

See the following for more info:

Chapter 18: Developing International Applications of the VFP programmers guide - section: Working with Code Pages

INFO: Code Page Information Stored in Byte 29 of Table Header
Jon Hawkins

The World Is Headed For Mutiny,
When All We Want Is Unity. - Creed
 
this is matthew again,

thank you for your quick responses (especially you-Walid). you have all given me educated opinions on my dilema. thank you. i wish to give further detail.

i am trying to import a deliminated-text file into foxpro 6.0. the file is deliminated w/carriage return line feeds, designating end of each field, and carriage return form feed to designate the end of each record. VFP would then makes changes to to the file.

i then need to export the file to a commercial injetting system (must be in text format). i do this by the 'COPY TO' command i mentioned before. the problem is: at the end of each record (in the exported file) where there is supposed to be only a carriage return form feed (0D 0C), foxpro inserts a line feed (0D 0A 0C) between the carriage return and form feed.

how do i stop this?

thank you, matt kraus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top