Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AT()
Message
 
 
À
10/03/1998 02:29:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Re: AT()
Divers
Thread ID:
00083552
Message ID:
00083587
Vues:
21
>Working with VFP 3.0
>I am getting data from text files into memo field with APPEND MEMO memofield FROM textfile OVERWRITE. The text file contains multiple data in no particular order (no columns,no CR/LF).

Angel, you might try this approach:

- How many different delimiters/keywords are there that separate the "lines"? Are there several different ones, or just one?
- Consider reading the files in 48K segments and doing a bit of buffering on your own.
- Now, you have two choices:
1. You can continue to use the At() method to find the string(s) you are looking for. When you get into the last 1024 bytes of your 48K segment, read the next 48K and append it to the tail. Then start over.
2. This might work MUCH faster: Use the StrTrans() function to convert your keywords into a chr(x)+CRLF sequence, where x is just a number from 128 upwards that denotes which particular keyword you are looking for. Set your memowidth to 1023. Now go through the string with MLine (be sure to read the docs on how to use MLine efficiently). All lines ending with asc(x) > 128 are "hits". All lines that don't are simply lines greater than 1023 characters long. If the keywords you are seeking are always less than 1023 characters apart AND if you looking for only 1 keyword, then you can skip the chr(x) stuff and just use CRLF to denote your found keywords. This all assumes there are no CR's in your original text string.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform