Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

917.Batch file rename -- How to copy one file for many times with pre-defined name in a list?

User: Vlad -- 2012-02-09          << 916  918 >>
Hits: 159
Type: Batch file rename   
Search all Batch file rename examples
Description:
what is the easiest way to make 50000 copies of a file, and rename them with following format:
word1-xxxx-yyyy-00001.txt
word1-xxxx-yyyy-00002.txt
...
word1-xxxx-yyyy-50000.txt

where xxxx comes from a list of word in cities.txt,
yyyy comes from a list of states.txt


Input Sample:
file: origin.txt

file cities.txt with following lines:
c1
c2
c3
...
c50000

file states.txt with following lines:
s1
s2
...
s50000
Output Sample:
copy origin.txt for 50000 times with following names:

word1_c1_s1_00001.txt
word1_c2_s2_00002.txt
word1_c3_s3_00003.txt
...
word1_c50000_s50000_50000.txt
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. join file cities.txt & states.txt to make a new file "c:\1.txt" with 100000 lines:

2. ctrl-h open 'replace' dialogue
3. set 'replace with pattern' to:

4. click 'advanced' tab
* set 'run following at the beginning of replace' to:

5. click 'replace' button, following text are generated:


5. ctrl-s save the text to file mycopy.bat
6. put the mycopy.bat into the same folder with origin.txt, and click mycopy.bat to run, done.


Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to copy a file 100 times with different name from 1.txt to 100.txt? (63%)
How to convert multiple text files to html files with self-defined format? (59%)
How to batch rename files by a filename mapping list? (57%)
How to split a file into many files by chapters, and use Chapter names as filenames? (56%)
How to batch rename files by adding timestamp of current time? (55%)
How to copy many files that defined in a list file to another folder? (55%)
How to rename many files with the last modified date of the file? (55%)
How to rename file by sequence id with specified pre-defined order? (55%)

Check Demo of Batch file rename
Keywords:
easiest way  500  what  ies  times  toc  fine  define  same  test  copy a file many times  rename from text list  copy and rename file  copy and rename  join file name  replace text rename  what is replace  same name