Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File manipulation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00273206
Message ID:
00274441
Vues:
37
Michelle;

I tend to use the low-level file manipulation functions, myself. Here's a snippet for reading a line in a file:

mHandle1=FOPEN(file_name)
DO Init_Thermometer
rdsize=10000
dummy=ALLTRIM(FGETS(mHandle1)) * This reads the first line, which is your header
DO WHILE ! FEOF(mHandle1)
curr_line=ALLTRIM(FGETS(mHandle1)) * This reads the first line of data
* process (modify your string, and put in into your table (or write to file)
ENDDO
=FCLOSE(mHandle1)

If you'll ultimately be putting the data into a table, you should probably do it directly. If you really need to write it back to another text file, you can either use textmerge, or use the low level functions again (FPUT, I think).

Good luck.

>>>>>Can anyone tell me how to do low level file manipulation in VFP? I have a file with row after row that looks something like this:
>>>>>
>>>>>01010212199909380000098463
>>>>>
>>>>>And I need to make it look like this:
>>>>>
>>>>>01010212990938098463
>>>>>
>>>>>Another tricky part is that the first line in the file is a header that's different from the rest.
>>>>>
>>>>>Thanks,
>>>>>
>>>>>Michelle
>>>>
>>>>If all you need to do is write a file, look at TEXTMERGE in Help. IMO, much easier than LLFO.
>>>
>>>Interesting function, but I don't see how that applies. I'm not merging anything...
>>>
>>>Thanks,
>>>
>>>Michelle
>>
>>
>>You don't need to merge with anything. It makes creating text files a piece of cake. I use it all the time.
>
>I guess I just don't see it. If it's short, could you show me what the code would look like?
>
>Thanks,
>
>Michelle
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform