in reply to Parse the text file output and delete files

Untested :). Also assumes case sensitive, in contradiction to your spec AND your code.

#!/usr/bin/perl use strict; $| = 1; $/ = 'ERROR at '; while(<>) { /ERROR at / && /[\0-\xff]*^executing: \@(.+)/m and (unlink $1 or warn "$1 $!"); }

Replies are listed 'Best First'.
Re^2: Parse the text file output and delete files
by Anonymous Monk on Jul 20, 2015 at 18:25 UTC

    Slight (hehehe) tweak for case insensitive.

    #!/usr/bin/perl use warnings; use strict; $| = 1; do{ local $/; $_ = <> }; $1 =~ /[\0-\xff]*^executing: \@(.+)/m and (unlink $1 or warn "$1 $!") while /(.*?)ERROR at/gi;
Re^2: Parse the text file output and delete files
by Gaurav99 (Initiate) on Jul 20, 2015 at 20:13 UTC
    Tried executing the above script got the below error C:\parse_test\test\dir1\dir1.sql at C:\test\script\per_test.pl line 9, <> chunk 2. C:\parse_test\test\dir1\dir2.sql at C:\test\script\per_test.pl line 9, <> chunk 4.

      Please put the error message in <code> tags.

      It doesn't look like there is an error, just an already unlinked file, but it's unreadable without code tags.

      Also, it looks like you typo'd the $!

Re^2: Parse the text file output and delete files
by Anonymous Monk on Jul 20, 2015 at 18:12 UTC

    So, do you really need case insensitive ?