Hi, I'm reading http://cybernetnews.com/find-replac... how to bulk find and replace words. He is using notepad ++.
So, is there is any method to bulk find urls within the text files and remove the urls using notepad ++.The urls I want to remove is anything begin with http:// or www. or anything ending with .com .org .net
Thanks. I really appreciate your help.
Regards,
Jerry
This gets out http:// and .net; you can guess the rest.
:: ===== script starts here =============== :: cut out http:// www .com etc :: jerry.bat 2012-12-16 15:00:39.42 @echo off > newfile & setLocal enableDELAYedeXpansioN for /f "tokens=* delims= " %%a in (myfile) do ( call :sub1 %%a echo !S! ) >> newfile goto :eof :sub1 set S= :loop echo %1 | find "http://" > nul || echo %1 | find ".net" > nul || set S=!S! %1 if "%2" neq "" ( shift goto :loop ) goto :eof ::====== script ends here ======================================
M2 Golden-Triangle
I don't see where notepad++ supports regexp, but I could be wrong. Vbscript, i think, has access to regexp, and probably applies it correctly. I would recommend this route, although I am not good with reg.exp. Also, if you could post sample of a file's content, that might help with further progress from forum contributors.
According to this http://cybernetnews.com/find-replac... . Is there is any method using notepad ++ to find and remove anything begin with http:// or www. or anything ending with .com .org .net from .txt files. I have few hundreds .txt need to bulk edit. Thanks.
Yes, you're right (I downloaded np++). Reg.exp IS supported. I haven't tried to test it yet. I guess "bulk edit" stipulation might be met by the macro menu. Sorry for the "non-answer", but I just wanted to let you know you're right and I'm wrong! ;-)
Maybe I'll get time to work with it (learning curve is always more like a tidal wave for me, not to mention me being sucky at reg.exp in general, and by now you've prob'ly got an answer anyhoos.).
Ps: As M2 indicated, some sample target-file content would help.
Might get done with a script, but not until we see some lines of the files. =====================
M2 Golden-Triangle
A quick Google search turned up this regular expression for URLs as the first hit. I haven't tested it, so use at your own risk, and whatnot.
This gets out http:// and .net; you can guess the rest.
:: ===== script starts here =============== :: cut out http:// www .com etc :: jerry.bat 2012-12-16 15:00:39.42 @echo off > newfile & setLocal enableDELAYedeXpansioN for /f "tokens=* delims= " %%a in (myfile) do ( call :sub1 %%a echo !S! ) >> newfile goto :eof :sub1 set S= :loop echo %1 | find "http://" > nul || echo %1 | find ".net" > nul || set S=!S! %1 if "%2" neq "" ( shift goto :loop ) goto :eof ::====== script ends here ======================================
M2 Golden-Triangle
