Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; ----------------------------------------
- In := "file.txt"
- Out := "url.html"
- FileRead, File, %In%
- StringReplace, File, File, `n, %a_space%, All
- Loop
- {
- if File not contains http://
- break
- else
- {
- link := RegexReplace(File, ".*http://(.*?) .*", "$1")
- StringReplace, File, File, http://%link%,, All
- link=<a href=`"http://%link%`">%link%</a><br/>
- exit := link exit
- }
- }
- FileAppend, % exit, %Out%
- ExitApp
- ; ----------------------------------------
- где In -- исходный файл, Out -- файл на выходе
- upd.: для всех файлов в указанной папке:
- ; ----------------------------------------
- Dir := "somedir"
- Out := "url.html"
- Loop %Dir%/*.txt
- {
- FileRead, File, %Dir%/%A_LoopFileName%
- StringReplace, File, File, `n, %a_space%, All
- Loop
- {
- if File not contains http://
- break
- else
- {
- link := RegexReplace(File, ".*http://(.*?) .*", "$1")
- StringReplace, File, File, http://%link%,, All
- link=<a href=`"http://%link%`">%link%</a><br/>
- exit := link exit
- }
- }
- }
- FileAppend, % exit, %Out%
- ExitApp
- ; ----------------------------------------
- где Dir -- папка с файлами, Out -- файл на выходе
Advertisement
Add Comment
Please, Sign In to add comment