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: 448
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 the same words in text files with different strings? (67%)
How to replace file content in multiple files with corresponding filename? (64%)
How to merge two or more csv files with different columns into one file? (59%)
How to replace adjacent multiple spaces in a text files into one tab? (59%)
How to batch replace word "old" in many files with different words "new1","new2",...? (59%)
How to replace multiple text in multiple files with variable strings? (58%)
How to replace words in a text file only if they are whole words? (57%)
How to search and replace multiple files with rules different in sequence number? (56%)

Check Demo of Replace text in multiple files
Keywords:
tabs  abs  contents  system  strings  toc  same  find  import  order  replace same with different  replace content multiple files  content replace multiple  strings files  replace same word  replace string in multiple files  different word file  make multiple files from text file