On 05/08/2018, at 02:26, Doug Lerner <d...@lerner.net <mailto:d...@lerner.net>> 
wrote:
> Using Find with grep checked on I'm looking for lines in a large file 
> containing this pattern: 
> 
> registeredTd="11/\d\d/2017
> 
> It stands for a registered date of November, 2017.
> 
> If I "find all" I get 69 occurrences of the pattern in the file.
> 
> But how, then, can I copy those found lines?


Hey Doug,

I took a quick look, and if you use Preview to view your PDF files then finding 
this in the manual is pretty easy.

Search for “find lines”, and the 4th item is “Process Lines Containing”.

This is the simplest of the available options (which Rich mentioned).

You discovered “Find All”, but you missed the “Extract” button in the Find 
dialog.  (Right after “Find All” in the manual.)

“Extract” takes just a little more work than “Process Lines Containing”, 
because it doesn't automatically return lines.  You have to add a little regex 
to pull up the whole line:

.*registeredTd="11/\d{2}/2017.*

Ctrl-Cmd-G is the keyboard shortcut on my machine for “Extract”.  (I don't 
think I changed the default but am not certain.)

NOTE - this feature is only available when the Find dialog is open.

There are a variety of scripted options available as well, and you can directly 
script “Process Lines Containing” via AppleScript.


tell application "BBEdit"
    tell front text document
        process lines containing matching string 
"registeredTd=\"11/\\d{2}/2017" matching with grep true ¬
            output options {copying to new document:true} without case sensitive
    end tell
end tell


So if you do this sort of operation frequently you can save the script, give it 
a keyboard shortcut, and go-to-town.

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To post to this group, send email to bbedit@googlegroups.com.
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to