| User: Aaron -- 2012-07-23 << 976 978 >> |
| Hits: 4251 |
| Type: Text merge |
| Search all Text merge examples |
| Description: |
| How to make random line by line sequential merge of multiple text files? choose only one sequential line from each text file. For example; line 1 from text 4, followed by line 2 from text 3, followed by line 3 from text 1, followed by line 4 from text 2, etc. A line must be chosen from each file before the process is repeated. |
| Input Sample: |
| - CONTENT OF Text1.txt : Text1 - Line1. Text1 - Line2. Text1 - Line3. Text1 - Line4. etc. - CONTENT OF Text2.txt : Text2 - Line1. Text2 - Line2. Text2 - Line3. Text2 - Line4. etc. - CONTENT OF Text3.txt : Text3 - Line1. Text3 - Line2. Text3 - Line3. Text3 - Line4. etc. - CONTENT OF Text4.txt : Text4 - Line1. Text4 - Line2. Text4 - Line3. Text4 - Line4. etc. |
| Output Sample: |
| Text4 - Line1. Text2 - Line2. Text1 - Line3. Text3 - Line4. Text1 - Line5. Text4 - Line6. Text3 - Line7. Text2 - Line8. etc. |
| Answer: |
| Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
| Assume: 1. the diretory of your files are: d:\test 2. all .txt files in folder d:\test may be randomly selected. 3. there are 100 lines in each file Procedure: 1. ctrl-h open 'replace' dialogue 2. set 'replace with pattern' to: 3. click 'advanced' tab * set 'run following at the beginning of replace' to: 4. click 'replace', done. 5. ctrl-s save result to file. Note: 1. the real folder should be in place of "d:\\test\\", and double backslash should be used as delimiter 2. the real number of line should be in place of $L=100, you can also use $L=count(file_content('d:\\test\\Text1.txt'),'\n') instead |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |