hhajjali: -------------------------------------------------------------------------------- Hello I am trying to create a script that have the same functionality as yours but it will delete lines with specif word in the line. ...--------------------------------------------------------------------------------
Hi, I guess, you can use the scripts for multiline replacement and choose an appropriate regular expression for your case. http://forum.pspad.com/read.php?2,12797#msg-12805 If you wanted to have an one-purpose script for that, a simple way could be e.g. cite: -------------------------------------------------------------------------------- //// ... PSPad\script\JScript\removeLinesMatchingRE.js /// var module_name = "removeLinesMatchingRE"; var module_ver = "1"; function removeLinesMatchingRE(){ // removes all lines matching a certain RE if (editorsCount()<1){return;} var actEd = newEditor(); actEd.assignActiveEditor(); var inputTxt = actEd.text(); var outputTxt = inputTxt; // RE replacement // adjust the regular expression as needed outputTxt = outputTxt.replace(/[^ ]*LINE NOT NEEDED[^ ]*\r?\n?/gi, ""); actEd.text(outputTxt); } function Init(){ addMenuItem("remove not needed lines", "", "removeLinesMatchingRE","Ctrl+Shift+W"); } -------------------------------------------------------------------------------- hth, vbr -- <http://forum.pspad.com/read.php?2,48553,50127> PSPad freeware editor http://www.pspad.com
