#182126 - 2007-10-31 01:36 PM
Kixtart Function similar to grep in unix?
|
Darren_W
Hey THIS is FUN
Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
|
Hi,
I'm looking to parse a log file for lines of text, I'm used to using grep in linux, eg >>>cat file.txt|grep "started"<<<
This would echo the lines with this string to the screen, I would like to extract these details and send them to a text file.
Is there anything similar in kixtart
Darren
_________________________
I want to share something with you - the three sentences that will get you through life. Number 1, 'cover for me.' Number 2, 'oh, good idea, boss.' Number 3, 'it was like that when I got here'.
|
Top
|
|
|
|
#182128 - 2007-10-31 02:17 PM
Re: Kixtart Function similar to grep in unix?
[Re: Gargoyle]
|
Howard Bullock
KiX Supporter
Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
|
If you did not want to walk through the file using READLINE, then you would have to use an external tool such as FIND.EXE (part of windows) or Regular Expressions COM object.
|
Top
|
|
|
|
#182129 - 2007-10-31 02:21 PM
Re: Kixtart Function similar to grep in unix?
[Re: Gargoyle]
|
Darren_W
Hey THIS is FUN
Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
|
Ok,
Tried that and it did not seem to work?
in the mean time created this using the pipe function
Open (2,$logpath+"outputmine.txt",5) $array = pipe('type '+$file+' |find "started"') For Each $file In $array Writeline(2,$file+@CRLF)? Next Close(2)
does the trick...
Darren
Edited by Darren_W (2007-11-02 05:00 PM)
_________________________
I want to share something with you - the three sentences that will get you through life. Number 1, 'cover for me.' Number 2, 'oh, good idea, boss.' Number 3, 'it was like that when I got here'.
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 248 anonymous users online.
|
|
|