Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1304.Advanced search and replace -- How to replace the User-Defined lines of A text from B text?

User: Nan Li -- 2015-05-03          << 1303  1305 >>
Hits: 2783
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
I want to inquire how to replace the User-Defined lines of A text from B text. For example: 
In A text, I has Lines No. 2, 7, 12, 17, ..., 3342 [ i.e. 2+N*5 (N=0, 1, 2, 3, 4, 5, ..., 668) ] 
 
In B text, I has Lines No. 2, 6, 10, 14, ..., 2930 [ i.e. 2+N*4 (N=0, 1, 2, 3, 4, 5, ..., 732) ] 
I would like to replace Lines No. 2, 7, 12, 17, ..., 3342 in A text by Lines No. 2, 6, 10, 14, ..., 2930 in B text. 
Can this software's command complete this task? 
Input Sample:
A.txt 
A1 
A2 
... 
A3342 
 
B.txt 
B1 
B2 
... 
B2930
Output Sample:
A.txt 
A1 
A2 replaced by B2 
A3 
A4 
A5 
A6 
A7 replaced by B6 
A8 
A9 
... 
A3342 replaced by B2674 
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume B.txt is in d:\test\ folder 
1. ctrl-o open A.txt 
2. ctrl-h open "replace" dialogue 
* set "replace unit" to "Line" 
* set "unit number filter" to:  
* set "replace with pattern" to: 
 
* click "advanced" tab: 
* set "run following at the beginning of replace" to: 
 
3. click "replace", done. 
 
Note: you need to use double backslash for folder separator like: d:\\test\\b.txt

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How do I replace specified lines with each line from a file? (67%)
How to replace letters with predefined numbers in a text range? (67%)
How to replace specified lines with each line from a file respectively? (63%)
How to make search and replace only in specified lines in text file? (63%)
How to replace all duplicate lines with some text? (63%)
How to replace different lines with different rule? (62%)
How to replace or remove 3 lines randomly in a text file? (62%)
How to replace the second character of every line to 4 in a text file? (62%)

Check Demo of Advanced search and replace
Keywords:
complete  task  software  user defined  command  backslash  double  comp  slash  define  double lines  how to split text by number of b  search for lines beginning  split by lines  lines beginning with  10 lines  ctrl h replace example  lines split