I'm trying to write a script that will open an ascii file, search for
a word, delete the entire line that word is on, then search again to
EOF, and save. Apple Script gives me the shivers. Usually, if I can
find a script that does something similar to what I need, I can modify
it to make it
On 5/1/2009, Greg Reyna said:
I'm trying to write a script that will open an ascii file, search for
a word, delete the entire line that word is on, then search again to
EOF, and save. Apple Script gives me the shivers. Usually, if I can
find a script that does something similar to what I need,
No need for exposure to Applescript. Create a new text factory in
BBEdit. Add a step Process lines containing. In the options of that
step make sure you have the option Delete matched lines selected.
(I recommend the Text factories chapter in the BBEdit User Manual
(chapter 5) for more on text
At 22:42 -0700 1/5/09, Greg Reyna wrote:
I'm trying to write a script that will open an ascii file, search for
a word, delete the entire line that word is on, then search again to
EOF, and save.
A UNIX Filter such as this ought to do the trick:
#!/usr/bin/perl
my $word = something;
while () {
Thanks Steve, that worked perfectly. I didn't know about that menu item.
Also thanks to Seth and Roland. I'm in the middle of learning Python
(a language that makes a heck of a lot more sense to me that AS!),
and would like to explore Grep. Being a non-math person with a son
that's a math
At 19:14 +0100 5/2/09, John Delacour wrote:
#!/usr/bin/perl
my $word = something;
while () { /$word/ or print }
Noting is ever simple.
That would need modification to handle the case there the letters constituting
$word appear within another word that has more characters than $word.
while ()
On 5/2/2009, Doug McNutt said:
Is a start requiring that $word be surrounded by two non-word characters but
will fail when $word begins or ends a line.
There's also the problem that perl's definition of a word character includes
programming conventions, particularly the underscore.
BBEdit
On Sat, May 02, 2009 at 01:05:30PM -0600, Doug McNutt wrote:
That would need modification to handle the case there the letters
constituting $word appear within another word that has more characters
than $word.
while () { /\W$word\W/ or print }
Is a start requiring that $word be