Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ctrl linefeeds embedded in CSV field
Message
De
19/10/2010 13:15:33
 
 
À
19/10/2010 12:27:07
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01486146
Message ID:
01486159
Vues:
52
Since I'll probaby forget what I did, I'll record it here :

To replace a special character in all Excel cells :
Sub repLF()
For Each cl In Worksheets("201006 excel").Cells.SpecialCells(xlCellTypeConstants, 23)
    cl.Replace What:=Chr(13), Replacement:="---", SearchOrder:=xlByColumns
Next cl
End Sub
If anyone knows how to tell the Worksheets() "whatever is the current worksheet please let me know.

I'm pretty comfortable with VS macro syntax but Excel is new to me.

Now at least I can load the csvs into Excel, massage them, and export a new csv that is more fox-friendly.

>Decided the best way to munge csv files I'm getting Adobe pdf exports is the Fox, but I'm running into problem with memo-type files Adobe is exporting that contain chr(10)+chr(13).
>
>When the csv comes into excel, the field shows as multiple lines. When I try to use that same csv for appending to a VFP dbf, the ctrl linefeed pair is of course seen as the end of the record. I've been massaging the csv using fox's wonder filetostr and strtofile. Problem is i can't figure out how to distinguish between the embedded pairs which I i would like to just replace with "----" or something until I can get them into a VFP memo field and put the linefeeds back and the pairs at the end of a record.
>
>I could live with a technique in Excel that would let me replace the linefeeds in the cells in that column ( I know *nothing* about Excel ) and then export the resulting massaged xls as a csv.
>
>Would welcome any suggestions. There are about 10 columns with this problem and there is no control on the Adobe end of how to export this stuff. ( they are fields in filled out pdf forms where the data type were defined pretty haphazardly by someone who knew nothing about data and was just putting something up for manual entry - but I have a couple thousand records like this with 200 + fields I need to convert to VFP so I can then massage out child data and push data into an existing SQL database )
>
>Oh, secondary question - I forgot - what is the limit on the number of fields in a VFP DBF (assuming in DBC ) ?
>
>TIA


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform