Re: Search a file question - Mac OS 9
Re: Search a file question - Mac OS 9
- Subject: Re: Search a file question - Mac OS 9
- From: bill fancher <email@hidden>
- Date: Tue, 17 Sep 2002 11:21:25 -0700
On Tuesday, September 17, 2002, at 10:24 AM, Charles Heizer wrote:
Hello,
I'm having some trouble getting a script to read a log file to work
properly.
I'm trying to find any line that that contains "RC [someerror]" for
example. Then write that line with it's line number out to a new text
file. The thing is I don't want it to grab the lines that contain "RC
[0]" because a return code of zero means there were no problems.
Assuming "someerror" is always a number:
do shell script "grep -n 'RC \\[[1-9][0-9]*\\]' /path/to/input >
/path/to/output"
You can pipe that through something else if you need to tweak the
output format. Let us know...
HTH,
--
bill
Thanks,
- Charles
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.