I have a file with approx 80,000 records. I need to copy one field "date1" to a text file and strip blank chars at the line.
I'm using Visual Foxpro 7. I tried to use trim with the copy to temp sdf command but it just gave me an error.
SDF format is defined by no delimiter nor separator, so fields are not trimmed, from that alone it doesn't make sense to trim the field while outputting. Besides that the COPY TO command only accepts a field list, not a list of expressions like ALLTRIM(field).
You can output to a txt file without COPY TO, There are FPUTS or STRTOFILE, just generate line by line, for example via STRTOFILE(Alltrim(date1)+chr(13)+chr(10),"out.txt",.t.) in a SCAN..ENDSCAN.
Ok Ali, but that'll only remove completely blank records, I think HAINC wants to get rid of trailing space of each record, and that's not done with COPY TO.
Hmm, So, HAINC wants them like this?
01/01/20120101201301012014 etc..?
or
01/01/2012 (<- no space here, just chr(13)+chr(10))?
01/02/2012
HAINC, can you show us your desired output file.. how you want it to look like?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.