Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

321.Replace text in multiple files -- How to search hundreds of xml files for a list of numbers, find out which file contains which number?

User: Jon -- 2009-03-18          << 320  322 >>
Hits: 3628
Type: Replace text in multiple files   
Search all Replace text in multiple files examples
Description:
I have to search through several hundred files for the presence of numbers from  
a list.  I need a report which tells me the number and which file it was found  
in (as CSV).  Note the numbers will sometimes appear with dashes in them in the  
target files, I need the numbers to be recognized with or without dashes.
Input Sample:
55289077314 
58864069830 
59772037704 
59772037707 
62584099401
Output Sample:
55289077314,file1.xml 
58864069830,file2.xml 
59772037704,file3.xml 
59772037707,file2.xml 
62584099401,file4.xml
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. Import the number 
1) ctrl-o open the file containing number list 
2) ctrl-h open 'replace' dialog 
* fill in 'search for pattern': 
 
click 'advance' page: 
* set 'run following at the beginning of replace' to: 
 
* set 'run following for each matched unit' to: 
 
3) click 'Replace'. 
 
2. Search files 
1) ctrl-h open 'replace' dialog 
* set 'search for pattern' to: 
 
* set 'Replace with pattern' to: 
 
click 'Advanced' page 
* set 'Run following for each matched unit' to: 
 
* Reselect the '>' to '>> Append' between 'in page' and 'out page' 
2) Click 'Batch...': 
* Click 'Pick Files' to pick multiple files 
* Check 'Set output filename', and select 01) file -> none 
* Click 'Batch Replace' 
 
3. Open result page, select 'Replace->Replace by Template->sort function->Sort and remove duplicate lines'..., done. 
 
*script is for step 2
Download Script:  scripts/321.rst.zip

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Screenshot 3:  Replace_Window


Screenshot 4:  Replace_Advanced_Window


Similar Examples:
How to batch rename files with the first line of file content as new file name? (59%)
How to batch rename files with the first word of file contents? (55%)
How to rename files to the first and last line of file contents? (54%)
How to batch rename files to the first 8 characters of the second line of file content? (54%)
How to batch rename files to the first date found in the files? (53%)
How to find the maximum number in each line that contains 3 numbers? (53%)
How to batch rename files by removing the first 3 characters of each file name? (53%)
How to batch rename files to the specified pattern found in file content? (52%)

Check Demo of Replace text in multiple files
Keywords:
report  dash  xml files  sort and remove duplicate  several  xml  xml file  remove duplicate lines  list of numbers  remove duplicate line  replace xml in multiple files  remove duplicate lines from multiple files  replace text in multiple xml files  find replace text multiple xml files  find numbers between  containing between  remove duplicate numbers  search for duplicate lines in multiple files