Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

434.Replace text in multiple files -- How to replace one content of same files with different contents ?

User: michale -- 2010-02-27          << 433  435 >>
Hits: 2754
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
How to replace one content of same files with different contents ?
For example. I have 4 txt files, they contains the same word "trust ", right now, I want to replace the 4 files, the results are"trust me", "trust jack", "trust mike", "trust you"
Thanks
Input Sample:
I trust. 
I have 4 files above
Output Sample:
The results are:

I trust me
I trust jack
I trust mike
I trust you
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume you need replace file1.txt, file2.txt, file3.txt, file4.txt, ....

1. First of all, prepare a text file(such as a.txt) that contains your new strings in each line:

trust me
trust jack
trust mike
trust you
...

2. Load a.txt into system
(1). ctrl-o open a.txt
(2). ctrl-h open 'replace' window
* set 'Replace Unit' to 'Line'
* click 'Advaned' tab
set 'Run following at the beginning of replace' to:

set 'Run following for each matched' unit to:

* click 'Replace', the new strings will be imported into system.

3. Replace all files
(1) ctrl-h open 'Replace' window
* in 'Search for pattern', enter the string to find:

* in 'Replace with pattern', enter following:

(2)click 'Batch...' open 'Batch Runner' window.
* drag all files(file1.txt, file2.txt, ...) from file browser to 'Batch Runner' window, make sure they have right order.
* click 'Batch Replace' button, done

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Screenshot 3:  Replace_Window


Similar Examples:
How to replace content of many files with text from a template file? (67%)
How to replace the same words in text files with different strings? (67%)
How to replace different lines with different rule? (66%)
How to replace file content in multiple files with corresponding filename? (64%)
How to remove duplicate lines in multiple files in different sub-folders? (62%)
How to extract specified lines in different section of text file? (61%)
How to replace certain column from different files?  (61%)
How to extract the forth column in the second line from different files? (60%)

Check Demo of Replace text in multiple files
Keywords:
tabs  abs  contents  system  toc  same files  strings  pare  contains  import  replace same with different  replace different to same  make all files same text  replace word contains  contains word  replace multiple strings  text to beginning to multiple text files  strings files