Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ctrl linefeeds embedded in CSV field
Message
 
 
À
19/10/2010 13:15:33
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:
01486162
Vues:
39
254 fields. I think there is ActiveSheet property of the Application object.

>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
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform