Hi, I think it is worthwhile to study the procedures developped by Vilhelm to export, import or append from for XLSX and XLS files. To transport an memo field with >254 char into Excel is no problem at all, the limit for a memo is not # of characters but the size in KB. Vilhelm's blog and coding you can find at http://praisachion.blogspot.com/ Please report back in case you have problems with any of his procedures. Regards, Koen
Op vr 3 mei 2019 om 22:14 schreef Charlie-gm ccbibleman@gmail.com:
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.
[excessive quoting removed by server]