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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML File

Status
Not open for further replies.

tlaakso

Programmer
Mar 13, 2002
17
ES
I'm generating an Ascii file with xml format to export data from a clipper aplication to a windows application. First I write all the data to a DBF file and finally I use COPY TO to a file with .xml extension.
But the second application fails to import the file because of the "end of file mark". I delete this mark with (for example) notepad and then the importation works fine.
Is there a way to generate the Ascii file without this 'end of file mark'???
Having to do it manually is not a solution. The final user will have to do the exportation several times a day.
Thanks
 
After writing the file with the COPY TO command, reopen the file that was created with low-level access and move the pointer to the end of the file, back up one bit, then resave the file.
 
Why don't you write to the ascii output file directly?
- use FCreate function to create the file
- use FWrite function to write all data out
- use FClose to close the file

If another app is triggered by the existence of the .xml file, create as .tmp (or .mytmp) and use FRename function as the 4th step in above procedure.
IMHO this will be quicer as you don't have to create and fill the 'intermediate' .dbf file.

HTH
TonHu
 
I've tried the solution sboomer gave to me and it worked fine.
But I think maybe TonHu is right. I will have to check if it's too much work to rewrite the code I've already done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top