Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CSV with Memo fields
Message
 
 
À
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:
01666489
Vues:
53
>>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.)
>
Thank, Antonio, looks like what I may need. Also, the column names seem to be with spaces in them - I'm guessing can we just convert to Excel with memos and pre-defined headers?

The other complication is the extraction of the data itself - I will need to figure the DB out as well as how to get all the needed info properly. I was hoping it would not be too complicated, but looks like it's going to be :(
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform