Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

1031.Text merge -- How to insert lines between sentences with specified order?

User: Aaron -- 2012-12-07          << 1030  1032 >>
Hits: 4140
Type: Text merge   
Search all Text merge examples
Description:
Merge lines from a file between two sentences in the order as per output: 
 
See the boy run. 
He ran home. 
 
Line Insert File (numbers added): 
 
1.  The sun was shining. 
2.  The dog barked. 
3.  It was windy. 
4.  His name is Paul. 
5.  The man smiled. 
6.  Today was Monday. 
7.  He was thirsty. 
8.  He was excited. 
9.  A bird flew by. 
10. He saw a yellow car. 
11. It was a nice day. 
12. He saw a friend. 
13. He was late. 
14. The cat ran away. 
15. He clapped his hands.
Input Sample:
See the boy run. 
The sun was shining. (1st line merge) 
He ran home. 
 
See the boy run. 
The dog barked.      (2nd line merge) 
The sun was shining. 
It was windy.        (3rd line merge) 
He ran home. 
 
See the boy run. 
His name is Paul.    (4th line merge 
The dog barked. 
The man smiled.      (5th line merge) 
The sun was shining. 
Today was Monday.    (6th line merge) 
It was windy. 
He was thirsty.      (7th line merge) 
He ran home. 
 
etc.
Output Sample:
See the boy run. 
He was excited.      (8th line merge) 
His name is Paul.     
A bird flew by.      (9th line merge) 
The dog barked. 
He saw a yellow car. (10th line merge) 
The man smiled.       
It was a nice day.   (11th line merge) 
The sun was shining. 
He saw a friend.     (12th line merge) 
Today was Monday.     
He was late.         (13th line merge) 
It was windy. 
The cat ran away.    (14th line merge) 
He was thirsty.       
He clapped his hands.(15th line merge) 
He ran home. 
etc.
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume the file with lines are d:\test\1.txt 
1. ctrl-o open the source file with 2 lines. 
2. ctrl-h open 'replace' dialogue 
* set 'replace with pattern' to: 
 
* click 'advanced' tab, set 'run following for each matched unit' to: 
 
3. click 'replace', done. 
4. ctrl-s save to file.

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Similar Examples:
How to sort all lines of text by specified keyword? (67%)
How to extract all sentences that contain specified words? (64%)
How to shuffle all lines of text in specified range? (62%)
How to join many binary files to one single file with specified order? (61%)
How to extract all lines by specified words in group? (60%)
How to extract lines containg specified words from many files? (60%)
How to extract all lines that contain specified words or phrases? (60%)
How to re-group all elements in specified range? (59%)

Check Demo of Text merge
Keywords:
monday  dog  asp  sentences  merge lines  sentence  insert lines  day  merge line  led  dog name  merge two lines  replace sentences  merge file name  merge two  two lines  insert lines to each file  insert numbers