#32927 - 2002-11-20 08:01 PM
Re: Need to extract info from a log file
|
anthonyl
Fresh Scripter
Registered: 2002-11-19
Posts: 12
Loc: Work
|
Les,
I take your point but in my specific case, the words "sending " and "receiving " do not occur anywhere else and wont either.
Ant
|
|
Top
|
|
|
|
#32928 - 2002-11-20 08:08 PM
Re: Need to extract info from a log file
|
Les
KiX Master
   
Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
|
{edit} Was critiqueing my code, not your's.
Yeah, but what about the dot as in Lurenko's version.
Excuse that brain fart of earlier. Here's some better code. code:
Break on $sending='sending FTP_Iconsd.lnk 09/09/2001 20:44:00 (09/09/2001 00:00:00)'
if instr($sending,'sending ') $b=substr($sending,9,(instr($sending,'/')-12)) endif '['+$b+']' ?
$receiving='receiving IMS - Transferring Returns.doc (new file)' if instr($receiving,'receiving ') $c=substr($receiving,11,(instr($receiving,'(')-12)) endif '['+$c+']' ? get $_
[ 20. November 2002, 20:10: Message edited by: LLigetfa ]
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.
|
|
Top
|
|
|
|
#32931 - 2002-11-21 12:37 AM
Re: Need to extract info from a log file
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
anthonyl, how can you state that a file name would never ever contain "sending" or "receiving" as part of the file name. It may be unlikely, but a good coder will make every attempt to avoid the problem if at all possible.
|
|
Top
|
|
|
|
#32933 - 2002-11-21 01:14 AM
Re: Need to extract info from a log file
|
Howard Bullock
KiX Supporter
   
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
I removed my duplicate post
...so that I could explain the obvious and increase my post count
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 484 anonymous users online.
|
|
|