User: tendy -- 2010-04-17 << 480 482 >> |
Hits: 3380 |
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 |