Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

446.Advanced search and replace -- How to remove all folders in a list containg folders and files?

User: editor -- 2010-03-13          << 445  447 >>
Hits: 2116
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to remove all folders in a list containg folders and files? 
 
I have a list that containing many files and folders, how to remove all the folders and keep all files? Note that all folders are ended with a backslash.
Input Sample:
c:\folder1\ 
c:\folder1\file1 
c:\folder1\file2 
c:\folder1\file3 
c:\folder2\ 
c:\folder2\f1 
c:\folder2\f2 
c:\folder2\f3
Output Sample:
c:\folder1\file1 
c:\folder1\file2 
c:\folder1\file3 
c:\folder2\f1 
c:\folder2\f2 
c:\folder2\f3 
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source text file 
2. ctrl-h open 'replace' window 
* set 'Replace Unit' to 'Line' 
* set 'Search for pattern' to: 
 
3. click 'Replace', done! 
4. ctrl-s save to file
Download Script:  scripts/446.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to remove all lines that have duplicate contents in CSV files? (67%)
How to remove all lines containing key-board letters only? (65%)
How to remove all lines that contain one or more words in a list? (64%)
How to find all lines in file A that contain words in file B? (64%)
How to remove all the lines that do not contain any of words in a list? (64%)
How to reverse the order of the first column in text file? (63%)
How to remove lines containing specified words in a text file? (62%)
How to extract all lines that contain specific words in a file? (62%)

Check Demo of Advanced search and replace
Keywords:
folders  backslash  slash  keep  containing  las  folder  remove all  many files  old  many folders  folders files  file folders  replace text in files open source  replace in files open source  replace all in many files  replace text in many files  how to replace many text files