Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Separator = "#####";
- Delimeter = "|";
- document.selection.SelectAll();
- sel = document.selection.Text; //alert(sel);
- Lines = sel.split("\r\n"); //Using Windows Line Enders here
- SeparatorFound = false;
- aArr = new Array();
- nCount=0;
- for(L = 0, Ls = Lines.length; L < Ls; L++){
- if (Lines[L].indexOf(Separator) != -1){
- SeparatorFound = true; continue; //SKIP
- }
- if (SeparatorFound==false){
- aArr[L] = Lines[L]; nCount++;
- }else{
- aArr[L -nCount -1] += Delimeter + Lines[L];
- }
- }
- OUT = aArr.join("\r\n");
- editor.NewFile();
- document.write(OUT);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement