User: editor -- 2012-02-06 << 913 915 >> |
Hits: 5234 |
Type: Replace text in multiple files |
Search all Replace text in multiple files examples |
Description: |
How to remove duplicate lines in multiple files in different sub-folders? |
Input Sample: |
This is sentence1 This is sentence2 This is sentence2 This is sentence3 |
Output Sample: |
This is sentence1 This is sentence2 This is sentence3 |
Answer: |
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps. |
Assume all of your files are txt files under parent folder d:\test, and you need to delete duplicate lines in each file. 1. ctrl-h open 'replace' dialog * set 'replace unit' to 'Line' * set 'replace with pattern' to: click 'advanced' tab: * set 'run following at the beginning of replace' to: * set 'run following for each matched unit' to: 3. click "batch..." button to open "Batch Runner" window 4. click "search files" button * enter correct file name filter, such as: * enter correct search directory, such as: * check option of 'search subdirectory' to allow searching sub-folder * click "search" button to find all files, click "close" when finish. 5. click "batch replace" button, all files will have duplicate lines removed. Note: If your need to remove "similar" lines, not exact "same" lines, you need some change in step1. |
Screenshot 1: Replace_Window |
Screenshot 2: Replace_Advanced_Window |