Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Merging with a textfile
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Merging with a textfile
Divers
Thread ID:
00426538
Message ID:
00426538
Vues:
60
I asked this question before in the thread "Generating HTML", but none of the answers I got seemed to fit exactly what I'm trying to do. The HTMLmerge suggestion came close, but it does more than I want it to do.

Let's see if I can explain this better this time. I have a text file that is maintained by my husband. I want to embed references to fields in that text file. Then, in VFP 6, I want to take _one_ record from a cursor and fill in those fields. The resulting merge will be written into a different text file.

There is one text file for each record in the cursor. I don't want to use a report or build stuff in memory because the text file template needs to be accessable.

Here's an example:
CURSOR:

animal1   animal2
fox       dog
cat       mouse

TEXT FILE:

The quick brown %animal1% jumped over the lazy yellow %animal2%.  The %animal2% ran after the %animal1% and bit him.

RESULTS:

test1.txt
The quick brown fox jumped over the lazy yellow dog.  The dog ran after the fox and bit him.

test2.txt
The quick brown cat jumped over the lazy yellow mouse.  The mouse ran after the cat and bit him.
I've been looking at TEXTMERGE but the docs aren't very clear and I can't figure out if I can use it for this. I'm basically looking for a function that I can send the template textfile and the cursor to and it will make a new textfile using the current record.

Is there any such animal? If not, how do I do it?

Thanks,

Michelle
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform