Re: Extracting text from an Retrospect Log
Re: Extracting text from an Retrospect Log
- Subject: Re: Extracting text from an Retrospect Log
- From: Gnarlodious <email@hidden>
- Date: Mon, 13 Mar 2006 14:14:17 -0700
- Thread-topic: Extracting text from an Retrospect Log
Title: Re: Extracting text from an Retrospect Log
It sounds like Retrospect is so stupid it writes logfiles with Mac lineendings. You should use rsync, it is really the right tool for UNIX file synchronizing.
You need to first translate the logfile to UNIX lineendings so sed will recognize more than one long line:
-- I am adding more character here and double escaping them since they are all regex reserved characters (stupid Dantz programmers). You may need to add more characters here to identify the unique line, but you get the idea:
set someRegex to "\\\\]Retrospect\\\\$\\\\["
-- translate Mac to UNIX
do shell script "tr '\\r' '\\n' < '/tmp/Operations Log' > /tmp/Retrospect.txt"
do shell script "sed -n \"`sed -n '/" & someRegex & "/=' /tmp/Retrospect.txt | tail -1`,\\$p\" /tmp/Retrospect.txt"
That should do it.
-- Gnarlie
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden