Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CSV with Memo fields
Message
De
17/02/2019 19:05:33
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01666482
Message ID:
01666484
Vues:
62
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform