in reply to File Filtering... Help
With your less-than-ample description, that's the best I can do in short order. Note that this code is completely *untested*, but shouldn't need too much messaging.#!/usr/bin/perl -w my $file = shift; my $start = shift; my $end = shift; my $outfile = "$file.out"; open(IN, "<$file") || die "Can't open $file!\n"; open(OUT, ">$outfile") || die "Can't open $outfile!\n"; while(<IN>) { if (/$start(.*)$end/) { print OUT $1; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File Filtering... Help
by flounder99 (Friar) on Sep 12, 2003 at 18:31 UTC |