Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1240.Replace text in multiple files -- How to read each line of a file and insert into multiple files?

User: Lily -- 2014-09-03          << 1239  1241 >>
Hits: 1123
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
Insert keywords from file as first lines in numerous files
Input Sample:
Keywords
ID: 1
ID: 2
ID: 3

1.txt
XYZ

2.txt
XYZ

3.txt
XYZ


Output Sample:
1.txt
ID: 1
XYZ

2.txt
ID:2
XYZ

3.txt
ID:3
XYZ
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume keyword file is d:\test\keywords.txt
1. open "Tools->Batch Runner" window
2. drag multiple files from windows file browser to "Batch Runner" window
3. click "Fast Replace" button to open "Fast Replace" window.
4. click "add" to add new rules, leave "search" to be blank, set "replace" to:

and click "ok".
5. make sure "reg exp" option is checked, and click "start", done.

Screenshot 1:  Fast_Replace_Window


Similar Examples:
How to add empty line at begin of multiple files? (72%)
How to get the values from all lines of txt file and generate html files? (65%)
How to sort all the lines of a text file by order the multiple columns? (65%)
How to move the last line to the beginning for multiple text files? (64%)
How to remove/delete first column for multiple files? (64%)
How to batch change format of multiple files? (64%)
How to put each line of keywords into multiple files with random occurrence? (63%)
How to move the specified line to the end in multiple files? (62%)

Check Demo of Replace text in multiple files
Keywords:
insert keyword  leave  keywords  keyword  keyword file  mer  key  rules  blank  test  insert a new line of each file  insert a line of text into multiple test files  windows insert text into multiple files  insert multiple lines into text file  search multiple files keyword  insert line in multiple files windows  insert blank lines  add first line to start of each line