<< List all lines with string to another file To do: - add another script to JumpTo selected line History: 26 Aug1999 /djg 1. Add connection name for host files 2. Adjust tab stops for bigger documents /dlo 3. Print a line only once 08 Sep1999 /dlo 1. Added On commands for Case 22 Sep1999 /djg 1. Improved performance slightly. 2. Changed how the result file is created and populated so that there is more visual feedback. 19 Nov1999 /djg 1. Fix problem where the string is found in the last line of the file. >> name QSLListString group "&Utility" command "&ListString"; sub ListString( IgnoreCase ) if qedit.files<>{} file = qedit.activefile; r = dialog( "Enter the string to list", 1, "" ); if r.button=1 searchstr = r.enteredText; list = {}; if file.connectionname <> "" then list = list + (file.connectionname + ":" + file.fullfilename); else list = list + file.fullfilename; endif list = list + ""; outfile=newfile(); outfile.insert(list); found = file.find( string:searchstr, startattop:true, ignorecase:IgnoreCase); repeat while found line = file.gettext( startline: file.lastfoundline ); s = string(file.lastfoundline) + "??t" + line[1]; list = {}; list = list + s; list = list + ""; outfile.insert(list); writelog(s); if file.lastfoundline + 1 > file.linecount then found = false; else found = file.find( string:searchstr, ignorecase:IgnoreCase, startline: file.lastfoundline + 1 ); endif endrepeat outfile.tabs(clearall: true); outfile.tabs(setevery: 8); outfile.select(line:1, column:1); endif; endif; endsub; on command "&MatchCase" ListString( false ); endon on command "&IgnoreCase" ListString( true ); endon