in reply to How to scan a file, find a character string and print from that string to EOF

Here's one way

#!/usr/bin/perl -w use strict; open(OUT1, ">file1.txt") || die $!; open(OUT2, ">file2.txt") || die $!; while(<>){ print OUT1 if (1 .. /^DETSO1/) =~ /^\d+$/; print OUT2 if /^DETSO1/ .. eof; } __END__
  • Comment on Re: How to scan a file, find a character string and print from that string to EOF
  • Download Code