qtipextra
5,000+ posts
The Original
Im dusting off my brain, trying to write a in Perl.
What I am doing is taking a log file and trying to return just the filename.
A line of the log file looks like this:
This is the code that I have so far. I am trying to use the split function to return the only the filename (the one listed first)
And right now all this outputs is the last line of the log file, which is this:
Anyone good with perl help me out?
What I am doing is taking a log file and trying to return just the filename.
A line of the log file looks like this:
Code:
Error: SetupDecompressOrCopyFile() "C:\Documents and Settings\QTIP\Desktop\new\I386\BEEP.SYS" to "C:\UBCD4Win\BartPE\I386\SYSTEM32\DRIVERS\BEEP.SYS" 2: The system cannot find the file specified.
Code:
system ("cls") ;
open( FILE, 'log.log' ) or die( "Cannot open: $!" );
@log = <FILE> ;
close (FILE) or die ( "Cannot open: $!" );
foreach (@log) { @split = split (/Error:/, $_, 9999) ; }
print @split ;
Code:
Use the [<<] and [>>] buttons to jump to Error/Warning.