Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CSV with Memo fields
Message
From
17/02/2019 19:05:33
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01666482
Message ID:
01666484
Views:
61
>Hi everybody,
>
>I'm attempting to help someone in NY to extract their data from Exceed program into CSV file. The DBF have long Memo columns. I'm wondering what are my options to properly convert this info into CSV?
>
>Thanks a lot in advance.

Naomi,

You can use the CSVProcessor class to export the data. If the ultimate goal is to import the data into Excel directly, you'll just have to figure out what is the CSV schema the Excel installation is expecting. In the case of my Portuguese Excel, that will be a semi-colon as value separator.

Here is a simple how-to. You can see the result in the attached screenshot.
DO LOCFILE("csv.prg")

CREATE CURSOR SourceWithMemos (Identifier Integer, NameField Varchar(32), MemoField Memo)

INSERT INTO SourceWithMemos VALUES (1, "Joseph", "Some data." + CHR(13) + CHR(10) + "In many lines.")
INSERT INTO SourceWithMemos VALUES (2, "Mary", "Will it be inserted into Excel?" + CHR(13) + CHR(10) + "We're about to see!")

LOCAL CSV AS CSVProcessor

m.CSV = CREATEOBJECT("CSVProcessor")

m.CSV.Workarea = "SourceWithMemos"
m.CSV.ValueSeparator = ";"

m.CSV.Export("SourceWithMemos.csv", .T.)
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform