Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

249.Advanced search and replace -- How to batch insert the filename into the beginning of the file conent?

User: editor -- 2008-08-14
Hits: 240
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to batch insert the filename into the beginning of the file conent?
Input Sample:
A.txt:
line1
line2

B.txt:
line1
line2
Output Sample:
A.txt:
A.txt
line1
line2

B.txt:
B.txt
line1
line2
Answer:
Hint: You need to Download and install "Replace Pioneer" to finish following steps.
1. ctrl-h open "Replace" dialog
* select "Advanced" page
set insert begin text to:

2. click "Batch..." to open Batch Runner dialog
3. click "Pick Files" and select multiple files for processing.
4. click "Batch Replace", each filename will be added to the beginning of each file.

Similar Examples:
How to batch rename files with the first word of file contents? (65%)
How to sort the text file by the date at the beginning of each line? (62%)
How to change multiple files, adding filename at the beginning of each file? (61%)
How to insert a word or phrase to the begining of each line? (59%)
How to batch rename files by removing all the letters and keep the rest? (56%)
How to batch rename files by moving the leading numbers to the end? (56%)
How to batch rename files by a filename mapping list? (56%)
How to add a line number at the beginning of each line? (56%)

Check Demo of Advanced search and replace