Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1101.Text generator -- How to generate files from template file, where some variables come from a list?

User: editor -- 2013-07-10          << 1100  1102 >>
Hits: 3562
Type: Text generator   
Search all Text generator examples
Description:
How to generate files from template file, where some variables come from a list? 
I have a text file (mytxt.txt) containing sometext and VAR1, VAR2, VAR3 
I have file list.txt containing 100*3 words 
cat,bat,hat 
dog,hog,cog 
... 
For each first word(on each line) I wish to create a text file e.g. cat.txt,dog.txt etc. which is a copy of mytxt.txt where: 
VAR1 is replaced with the first word cat 
VAR2 is replaced with the second word bat 
VAR3 is replaced with the third word hat 
Input Sample:
mytxt.txt: 
.......VAR1 
....VAR2 
....... 
....VAR3 
 
list.txt: 
cat,bat,hat 
dog,hog,cog 
...
Output Sample:
cat.txt 
........cat 
....bat 
....... 
....hat 
 
dog.txt: 
.......dog 
....hog 
....... 
....cog 
 
... 
 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open list.txt 
2. ctrl-h open 'replace' dialogue 
* set 'replace unit' to 'Line' 
* click 'advanced' tab, set 'run following for each matched unit' to: 
 
3. click 'replace', all files will be generated under d:\test\folder. 
 
Note: assume mytxt.txt is under d:\test\ folder.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to create files from template where filenames and keywords come from a list? (73%)
How to generate a csv file from a template file and a list of words? (65%)
How to open a binary file and replace some bytes inside it? (55%)
How to generate EMA columns and related STD of close value from stock data? (54%)
How to batch rename files by a filename mapping list? (54%)
How to change a binary file into text file with readable hexidecimal format? (53%)
How to rename files to the first and last line of file contents? (52%)
How to rename files by adding folder name ahead and sequence behind? (52%)

Check Demo of Text generator
Keywords:
variables  dog  asp  third  variable  create a text  var  create  generate files  template  copy first line  file copy generator  create files from template  replace and create files from list  create files from text list  create a list of files  copy files from list  copy files from a text file