Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

914.Replace text in multiple files -- How to remove duplicate lines in multiple files in different sub-folders?

User: editor -- 2012-02-06          << 913  915 >>
Hits: 4981
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


Similar Examples:
How to remove duplicate sentences across many articles in different files? (72%)
How to remove duplicate lines from a text file? (67%)
How to save specified lines of text file into different files? (64%)
How to remove the last 3 lines of multiple text files all at once? (64%)
How to remove consecutive duplicate words in multiple files? (63%)
How to search and replace multiple files with rules different in sequence number? (63%)
How to extract first line from multiple files and generate a new file? (63%)
How to move all the jpg files to its parent folder? (63%)

Check Demo of Replace text in multiple files
Keywords:
similar lines  exact  subfolders  delete duplicate lines  delete duplicate line  subfolder  delete duplicate  chin  similar  remove duplicate lines  batch file to delete files not matched  batch file to delete duplicate lines in text file  batch delete duplicate lines  batch file delete duplicate lines  batch delete duplicate lines text  remove duplicate lines in txt file  delete duplicate lines batch  batch file to exact text pattern