Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

523.Replace text in multiple files -- How to change multiple files, adding filename at the beginning of each file?

User: editor -- 2010-05-31          << 522  524 >>
Hits: 4584
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
How to change multiple files, adding filename at the beginning of each file?
Input Sample:
original file1.txt: 
=================== 
line1 
line2 
line3 
line4 
... 
=================== 
Output Sample:
new file1.txt: 
=================== 
filename: file1.txt 
line1 
line2 
line3 
line4 
... 
=================== 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. open "Tools->Batch Runner" menu 
2. drag all text files from "Windows File Browser" and drop to "Batch Runner" window. 
3. click "Fast Replace" button, click "Add" button: 
* in "search" entry, enter: 
 
* in "replace" entry, enter: 
 
click "ok" 
4. make sure "Regular exp" and "Cross Line" options are checked, click "Start", all files will be modified

Similar Examples:
How to rename all files by adding a letter 'x' behind each filename? (66%)
How to add capitalized filename into beginning of each file? (65%)
How to merge many files into one file, and add filename before each file? (65%)
How to batch insert filename at start/beginning of each lines? (63%)
How to decrease the first 4 digits in the beginning of each line by 1000? (62%)
How to sort the text file by the date at the beginning of each line? (61%)
How to batch insert the filename into the beginning of the file conent? (61%)
How to search/replace multiple text files base on rules from csv file? (59%)

Check Demo of Replace text in multiple files
Keywords:
modified  adding filename  adding  cross line  at the beginning  beginning  begin  regular  regula  regular exp  adding text in filename multiple  change beginning of filename  text to beginning to multiple text files  change multiple filename from text file  change filename of multiple  make multiple files from text file  change text in multiple files  make multiple search and replace