RE: [NTS] output file of lines matching search string
- Yes, such a script exists. It is below. I use it all the time. As you can
see in the script thee is a link to the place on the net where this script
He also has a script that will DELETE LINES that match a certain criteria
and another to create a table structure.
Hope that helps.
^!Continue Find Lines v1.0^%NL%a NoteTab clip by Joe Barta -
HTMLisEasy.com^%NL%^%NL%This clip will scan your document looking for your
search phrase. If any lines containing your search phrase are found, they
are copied to a new document. Choose between a case-sensitive or
case-insensitive search, and chose whether you'd like your search results to
include line numbers.^%NL%^%NL%Note - It's meant to search for text line by
line, so searching for chunks of text that contain line breaks will probably
give unpredictable results. Also, there is no support in this clip for
regular expressions... yet.^%NL%^%NL%Click OK to proceed.
; Find Lines v1.0
; a NoteTab clip by Joe Barta - HTMLisEasy.com
; Scans document for lines containing a search term,
; then builds a new document containing those lines.
; Full details and instructions at the web site above.
;kill all variables hanging around in memory
^!Set %searchstring%=^?[Search for]
^!Set %linenumbers%=^?[(H=2)Include line numbers?==_yes|no]
^!IF ^$StrSize(^%searchstring%)$ > 0 SKIP_2
^!Prompt No search term entered. Aborting clip.
;is there a carriage return at the end of the doc?
^!If ^$GetCol$ = 1 SKIP_2
^!Continue I have to insert a carriage return at the end of your document in
order to process this clip. You can remove it later if you wish. Press OK to
^!Toolbar New Document
^!If ^%case% = 1 SKIP
^!Find ^%searchstring% TIS
^!If ^%case% = 0 SKIP
^!Find ^%searchstring% TS
^!IF ^$GetSelSize$ = 0 FINISH
^!If ^%linenumbers% = no SKIP
^!SetClipboard Line ^$GetRow$:^%TAB%^$GetSelection$
^!If ^%linenumbers% = yes SKIP
^!IF ^$GetTextSize$=0 NOMATCH_MESSAGE ELSE TITLE_LINE
^!Prompt No lines match ^%searchstring%
^!IF ^%foundlines%=1 LINE ELSE LINES
^!InsertText Found ^%foundlines% ^%line% containing ^%searchstring%^%NL%
From: firstname.lastname@example.org [mailto:email@example.com] On
Behalf Of rolfessenden
Sent: Monday, October 18, 2010 10:03 PM
Subject: [NTS] output file of lines matching search string
I am deciding to buy this (or not). One key task is to create an output file
of the lines containing the search string.
It looks like this is easy to do. Can anyone confirm that or not? Do such
scripts already exist?
Any help greatly appreciated.
[Non-text portions of this message have been removed]
- I'm not the moderator, nor do I object to you posting this question here, but you'll have a better chance for getting a helpful answer in other NoteTab groups. The "notetab" group discusses general usage of NoteTab, the "ntb-clips" group discusses INTERNAL scripts and macros, called "clips" in NoteTab.
This group supposedly discusses EXTERNAL scripts, in Perl, VB, JS, etc, and accessed by NoteTab as external programs.
In the "ntb-clips" there are a bunch of regular expression experts who can tell you how to do this in a one-line clip, or even how to do this from NoteTab's menu.
If you have experience in regular expressions, look in the help menu for "Help on Clip Programming", and search the help INDEX for the ^$GetDocMatchAll function. Properly primed, that function will collect what you want into an array, which you can then paste to another document.
--- In firstname.lastname@example.org, "rolfessenden" <rol@...> wrote:
> I am deciding to buy this (or not). One key task is to create an output file of the lines containing the search string.
> It looks like this is easy to do. Can anyone confirm that or not? Do such scripts already exist?
> Any help greatly appreciated.