On Aug 29, 2014, at 11:59, Randy Roberts <[email protected]> wrote:
> <thumb fileName="I1092_LS_ChxBS_IT_Bollard.jpg">Bacon Ranch Chicken Sandwich
> with Iced Tea Suite</thumb>
> ...
> There are thousands of lines but here are 3 of them. I need to select and
> delete everything from the beginning of the line up to the first instance of
> ">". The desired outcome would be:
>
> >Bacon Ranch Chicken Sandwich with Iced Tea Suite</thumb>
______________________________________________________________________
Hey Randy,
You say some files, so I imagine you might want to automate the process a bit.
Of these the Perl filter is fastest on a really big file (above 50K lines).
----------------------------------------------------------------------
RegEx Find/Replace using Positive Lookahead Assertion
----------------------------------------------------------------------
Find:
^.+?(?=>)
Replace:
Nothing
----------------------------------------------------------------------
AppleScripted RegEx Find/Replace
----------------------------------------------------------------------
tell application "BBEdit"
tell front text window's text
replace "^.+?(?=>)" using "" options {search mode:grep, case
sensitive:false, starting at top:true}
end tell
end tell
----------------------------------------------------------------------
Perl Text Filter
----------------------------------------------------------------------
#! /usr/bin/env perl
use v5.010; use strict; use warnings;
while (<>) {
if ( m!^.+?(?=>)(.+)! ) {
say $1;
} else {
print;
}
}
----------------------------------------------------------------------
To quickly get to your text filter folder if you haven't used it before paste
the following line into a BBEdit worksheet or the Terminal and run.
D=~/'Library/Application Support/BBEdit/Text Filters/'; mkdir "$D" > /dev/null
2>&1; open "$D";
--
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
"[email protected]" 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 [email protected].
To post to this group, send email to [email protected].