Does anyone have a quick and easy way to export a memo field(s) into Excel?
TIA/Appreciate the help. Regards, Desmond
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
I've not done this. I understand there isn't a VFP command that will do it. You need to either use Automation of another tool such as XFRX or SweetPotatoSoftware FLL that read/writes Excel files. I don't know that either will, nor if they have an example if they do.
Maybe someone else will chime in.
HTH, Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Desmond Lloyd Sent: Tuesday, April 30, 2019 1:01 PM To: profoxtech@leafe.com Subject: VF9: Exporting a Memo Field to Excel
Does anyone have a quick and easy way to export a memo field(s) into Excel?
TIA/Appreciate the help. Regards, Desmond
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
[excessive quoting removed by server]
Thank you!
On Tue, 30 Apr 2019 at 12:48, Tracy Pearson tracy@powerchurch.com wrote:
I've not done this. I understand there isn't a VFP command that will do it. You need to either use Automation of another tool such as XFRX or SweetPotatoSoftware FLL that read/writes Excel files. I don't know that either will, nor if they have an example if they do.
Maybe someone else will chime in.
HTH, Tracy
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Desmond Lloyd Sent: Tuesday, April 30, 2019 1:01 PM To: profoxtech@leafe.com Subject: VF9: Exporting a Memo Field to Excel
Does anyone have a quick and easy way to export a memo field(s) into Excel?
TIA/Appreciate the help. Regards, Desmond
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
SELECT LEFT(mMemo,255) as JustText INTO CURSOR Barney COPY TO example.csv TYPE CSV
... if all the memos are less than 256 characters.
On Tue, Apr 30, 2019 at 1:01 PM Desmond Lloyd desmond.lloyd@gmail.com wrote:
Does anyone have a quick and easy way to export a memo field(s) into Excel?
TIA/Appreciate the help. Regards, Desmond
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
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.
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.
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]
Desmond,
The CSVProcessor class in VFPX may do that for you.
m.CSV = CREATEOBJECT("CSVProcessor") m.CSV.Export("toExcel.csv", .T.)
On Tue, Apr 30, 2019 at 6:01 PM Desmond Lloyd desmond.lloyd@gmail.com wrote:
Does anyone have a quick and easy way to export a memo field(s) into Excel?
TIA/Appreciate the help. Regards, Desmond
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
Also this VFPx project works well and doesn't require Excel to be installed in order to directly create an XLSX file.
https://github.com/ggreen86/XLXS-Workbook-Class
--
rk
-----Original Message----- From: ProfoxTech profoxtech-bounces@leafe.com On Behalf Of António Tavares Lopes Sent: Wednesday, May 1, 2019 4:09 AM To: profoxtech@leafe.com Subject: Re: VF9: Exporting a Memo Field to Excel
Desmond,
The CSVProcessor class in VFPX may do that for you.
m.CSV = CREATEOBJECT("CSVProcessor") m.CSV.Export("toExcel.csv", .T.)
On Tue, Apr 30, 2019 at 6:01 PM Desmond Lloyd desmond.lloyd@gmail.com wrote:
Does anyone have a quick and easy way to export a memo field(s) into Excel?
TIA/Appreciate the help. Regards, Desmond
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]