Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Fast data transfer into Excel avoiding date problems
Message
De
03/07/2003 23:01:57
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00805939
Message ID:
00806839
Vues:
22
>> In theory, importing from CSV, indeed, seems better to me. I also suspect > you can insert it into any place.
>
>> Try if you can pre-format the column, where you will insert the CSV, as text.
>
>As far as I can tell, opening a .CSV file in Excel always starts a new sheet so the pre-format of the columns as text is left unused on another sheet.
>
>Also, I should mention my previous post I accidently showed a space following the comma in my example .CSV file which must be omitted for the other columns to load properly.
>
>I am also considering adding the extra "=" prefix character only if I really need it to prevent the data conversion. Unfortunately, this could be an intensive effort since things like "7440-09-7" should never have been assumed to be a date. UGH! As a related question, is there any fast way test if a string contains any alpha character? So for example I would add the "=" prefix if I had a code like "7440-09-7" with dashes in positions that might be dates, but not for codes like "7A40-09-7" that had an alpha character.
>
>Thanks,
>Jeff

Yes, with chrtran() you can strip out digits and hyphens. If the len() remains > 0, it means you have a letter, in your example, an "A".
? len(chrtran("7A40-09-7", "0123456789-", "")) > 0
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform