>how can I create a file csv with headers from vfp6.0 or to make a file txt for import it to any software. The software that I'm using is windowbook( Postal Post Office) and it requeries an import file. I used "Copy to (.txtfilename.value) type DELI" but when it maps the fields it does it with the first record wich is data and it doesn't match with the fields that it receives. Thanks a lot.
If the first record has to be the field name list, you could:
use mydata
copy to textfile.csv deli
lcTemp = filetostr('textfile.csv')
lcHeader = ""
for i = 1 to fcount()
if not empty(lcHeader)
lcHeader = lcHeader + ',"' +field(i) + '"'
else
lcHeader = '"' + field(i) + '"'
endif
endfor
lcTemp = lcHeader + chr(13) + lcTemp
strtofile(lcTemp, 'textfile.csv')
Mark McCasland
Midlothian, TX USA