I think you can also use the CAST clause to change the memo field to a C(254) and it will export OK (truncating things beyond 254 of course )
-Charlie
On 5/3/2019 1:51 PM, Ted Roche wrote:
On Tue, Apr 30, 2019 at 1:53 PM Ted Roche tedroche@gmail.com wrote:
SELECT LEFT(mMemo,255) as JustText INTO CURSOR Barney COPY TO example.csv TYPE CSV
... if all the memos are less than 256 characters.
But if the memos are too long, you'll get a "String is too long to fit" if you try to use an ALLTRIM() rather than a LEFT(). In that case, you could:
LIST OFF NOCONSOLE alltrim(string(FilePK))+ [,"] + FileMemo + ["] to file Barney.CSV
and you'll get a CSV file with the file primary key (FilePK in this case) followed by a comma and the Memo field in quotes.
YMMV, of course, and you might want to wrap a function call around FileMemo to your own UDF to strip out quotation marks, or carriage returns or the like.
For extra credit, you could use LLFFs to lop off the top line of the file that holds the field names, or tell your import program to ignore it.