Replace Pioneer Home   All Examples   Free Download

 New request --free  RSS: Replace Pioneer Examples

481.Advanced search and replace -- How to automatically add Previous and Next link for many html files?

User: tendy -- 2010-04-17          << 480  482 >>
Hits: 3194
Type: Advanced search and replace   
Search all Advanced search and replace examples
Description:
I want to add Previous/Next links right next to "head" tag in hundreds of html files.but their names are not regular.I have extracted all links in a.text,how can I achieve this?
Input Sample:
a.text: 
abv23.html 
we45h.html 
func/q9t_erk4.html 
func/fer4gf789.html 
func/midi/fefr543.html 
... 
awze3yy.html
Output Sample:
we45h.html:  
<html> 
<head> 
<a href=abv23.html>Previous</a> 
<a href=func/q9t_erk4.html>Next</a>  
some text here  
</head>  
some other text here  
</html>  
q9t_erk4.html, fer4gf789.html ... are similar
Answer:
Hint: You need to Download and install "Replace Pioneer" on windows platform to finish following steps.
Assume file a.txt contains all links like: 
abv23.html 
we45h.html 
func/q9t_erk4.html 
 
Prepare file b.txt that contains all html files with full path like: 
c:\temp\abv23.html 
c:\temp\we45h.html 
c:\temp\func\q9t_erk4.html  
 
1. Load links into system: 
(1) ctrl-o open a.txt 
(2) ctrl-h open replace window 
* set 'replace unit' to 'line' 
click 'Advanced' page: 
* set 'run following for each matched unit' to: 
 
(3) click 'Replace', all links will be imported to system 
 
2. Replace all files listed in b.txt 
(1) open 'Tools->Batch Runner' window 
(2) click 'Import List' button, and open b.txt to import all html files 
(3) click 'Fast Replace' 
* click 'Add', enter  in 'search' 
* enter following in 'replace' 
 
(4) make sure 'Regular exp' option is selected. 
(5) click 'Start', done! 
 
Note: Links in First/last file need manual modification

Screenshot 1:  Replace_Window


Screenshot 2:  Replace_Advanced_Window


Screenshot 3:  Fast_Replace_Window


Similar Examples:
How to automatically add Previous/Next links at the top of each static html files from A001.html to A200.html? (70%)
How to extract all image links from a html file? (59%)
How to extract all email addresses from many text files? (58%)
How to batch remove/delete first and last line of many text files? (58%)
How to extract all image links from multiple html files?  (57%)
How do I replace all the tags <hr /> in many html files? (57%)
How to change all the webpage address into links inside a html file? (57%)
How to extract/parse all http addresses from text/html file? (56%)

Check Demo of Advanced search and replace
Keywords:
href  a href  previous  system  path  extracte  full  many html files  links  tag  html next link  next link in html  link to next file  add head  add path  make links  replace all links in html page  search links