extrn

Untitled

Oct 23rd, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.31 KB | None | 0 0
  1. use IO::File;
  2. use strict;
  3. for my $file (@ARGV) {
  4.     warn("$file: $!"), next unless my $in = new IO::File($file, "<");
  5.  
  6.     my ($data, $var, $idx);
  7.     $data .= $var while $in->read($var, 1024);
  8.  
  9.     new IO::File(sprintf('%s_struct%02d.txt', $file, ++$idx), ">")->write($_) for $data =~ /(RTON.*?DONE)/gs;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment