At 18:38 -0500 3/3/10, Charles Hartley wrote:

I'm afraid you're way over my head, but I'm interested in learning how to use this.


Save it in your UNIX FIlters folder, open your file in a window and run the filter by clicking it in the palette, where you can also set a key shortcut for it if you're using it often.

while(<>) {
 #do these things
}

means read the front window line by line and do these things

s~x~y~  mean replace replace x with y

The regex patterns are pretty much the same as BBEdit uses internally.


The reason I suggest using Perl/Unix rather than AppleScript is that raw AppleScript is about the worst possible choice for manipulating text. The Barebones people, much to their credit, have extended this frightful language to make it possible, but it is still clumsy, verbose and unnnecessary. I use AppleScript only to get information from applications that I can't otherwise get and then pass all the real work to Perl. Working within BBEdit it is rarely necessary to use AppleScript at all.


#!/usr/bin/perl
my $print;
while (<>) {
 s~.*VALUES \((.*)~$1~ and $print=1;
 s~(.*)\);/\*!.*~$1~ and print $1 and $print=0 and $last=1;
 print if $print;
 last if $last;
}


JD

--
You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/bbedit?hl=en
If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group.

Reply via email to