For text processing, I use the jN plug-in for Notepad ++.
https://github.com/sieukrem/jn-npp-plugin
But it allows you to process text in the editor using JavaScript.
For example, cut lines longer than 300 characters:
function InputBox(psTxt, psCapt, psVal) {
var rv = psVal;
var so = new ActiveXObject(“MSScriptControl.ScriptControl”);
so.Language = ‘VBScript’;
var vCode =
’ Function getInputNumber() \n’+
’ val = InputBox(“‘+psTxt+’”,“‘+psCapt+’”,“‘+psVal+’”) \n’+
’ getInputNumber = val \n’+
‘End Function \n’;
so.AddCode(vCode);
rv = parseInt(so.Run(“getInputNumber”));
return rv;
}
// удаляем строки которые длинее n символов
function rowsOverLengthRemote(psOper) {
var vOLen = 300;
if(!psOper) { psOper = 1; }
vOLen = InputBox(‘Input length’,“For very long rows”,vOLen);
vOLen = parseInt(vOLen);
if(vOLen <= 40) {
return;
}
// debugger;
// return;
var vTextAll = Editor.currentView.text;
var vArr = vTextAll.split(‘\n’);
var vTextNeed = ‘’;
var vLine = ‘’;
for(var i = 0; i<vArr.length; i++) {
vLine = vArr[i];
if(vLine.length <= vOLen) {
vTextNeed = vTextNeed + ‘\n’ + vLine;
} else {
if(psOper == 2) {
message(“Cut string N: “+i+’ length” ‘+vLine.length+’ >> ‘+vLine.substring(0, 500));
vTextNeed = vTextNeed + ‘\n’ + vLine.substring(0,vOLen);
} else if(psOper == 1) {
message("Kill string N: "+i+’ length” ‘+vLine.length+’ >> '+vLine.substring(0, 500));
}
}
var myKillVeryLengthRows = {
text: “Удалить строки длинее N \tCtrl+Shift+K”,
ctrl: true, shift: true, alt: false,
key: 0x4B, // “K key”
cmd: rowsOverLengthRemote
};
addHotKey(myKillVeryLengthRows);
scriptsMenu.addItem(myKillVeryLengthRows);
function rowsOverLengthCut() { rowsOverLengthRemote(2); }
var myCutVeryLengthRows = {
text: "Обрезать строки длинее N ",
cmd: rowsOverLengthCut
};
scriptsMenu.addItem(myCutVeryLengthRows);
It also has the ability to display messages:
JavaScript alert (‘Message’) status (‘Message’); - in the status bar N ++ message (“Message”) - output to the man-made message box (my development):http://prntscr.com/j6s9j9