Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

300.Advanced search and replace -- How to replace all "ID" in following xml file with increased ID?

User: editor -- 2008-11-27          << 299  301 >>
Hits: 1818
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
How to replace all "ID" in following xml file with increased ID?
Input Sample:
<student id="ID" name="Tommy"> 
<student id="ID" name="Jenny"> 
<student id="ID" name="Mary"> 
<student id="ID" name="Harry"> 
...
Output Sample:
<student id="1" name="Tommy"> 
<student id="2" name="Jenny"> 
<student id="3" name="Mary"> 
<student id="4" name="Harry"> 
...
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
1. ctrl-o open source file 
2. ctrl-h open "Replace" dialog 
set "Search for Pattern" to: 
 
set "Replace with Pattern" to: 
 
3. click "Replace", done! 
 
Note: $word_no is the sequence number of matched unit.
Download Script:  scripts/300.rst.zip

Screenshot 1:  Replace_Window


Similar Examples:
How to replace strings in multiple files with a global  increasing ID? (61%)
How to remove the "." and following strings from multiple filenames? (60%)
How to replace all OLD with NEW only in line 100 to line 300? (59%)
How to replace all the numbers in a text file to the square value? (58%)
How to replace alt text with string from title tag? (57%)
How to replace the second column of a file with an increasing number? (55%)
How to replace strings in multiple text files with an increasing id start from 1? (55%)
How to make batch operations for following file list? (55%)

Check Demo of Advanced search and replace
Keywords:
logs  xml  xml file  increase  sequence number  increas  sequence  seq  matched unit  matched  matched sequence number  replace all in with xml  xml search replace  xml search and replace  replace xml  replace with sequence number  replace with number sequence  replace sequence number