Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1091.Advanced search and replace -- How to batch insert filename at start/beginning of each lines?

User: editor -- 2013-07-01          << 1090  1092 >>
Hits: 1386
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
There are many text files, how to insert filename into the begining of every line in each file?
Input Sample:
file1.txt:
line1
line2
line3

file2.txt:
line1
line2
line3

...
Output Sample:
file1.txt:
file1.txt line1
file1.txt line2
file1.txt line3

file2.txt:
file2.txt line1
file2.txt line2
file2.txt line3

....
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 multiple text files from windows file browser to "batch runner" window
3. click "Fast Replace" button
4. click "add" to add new rule:
* set "search" to: 
* set "replace" to:  or (no extension)
* click "ok"
5. check option of "reg exp", UNcheck option of "cross line"
6. click "start", done.

Screenshot 1:  Fast_Replace_Window


Similar Examples:
How to batch insert the filename into the beginning of the file conent? (76%)
How to sort the text file by the date at the beginning of each line? (71%)
How to batch insert file name in the text? (66%)
How to insert a word or phrase to the begining of each line? (66%)
How to add different words at the beginning of each line? (65%)
How to add a line number at the beginning of each line? (65%)
How to batch insert part of the filename into the file content? (64%)
How to batch split file delimitered by first dash in each line? (64%)

Check Demo of Advanced search and replace
Keywords:
begining  insert filename  extension  batch insert  every line  cross line  beginning  every  how to insert  insert  add text at begining  how to add begining of line  add text in the begining  how to add text at begining of each file  each line insert filename into  replace begining multiple text  insert begining of line  batch insert filename at start of lines