a perl question
Normand Marion
normand.marion at sympatico.ca
Tue Jan 4 15:18:44 UTC 2011
I am not a perl guru but, with the given information, your request
sounds like this
#!/usr/bin/perl
use strict;
use warnings;
my $in=$ARGV[0]; #Capture input file
open (F, "$in") or die "Cannot open $in $!";
while (<F>) { #read file to EOF
if ( /h/ ) { # match "h"
print $_;
}
}
close ("F")
normand.marion
Le 2011-01-04 05:28, S Mathias a écrit :
> cat asdf.txt
> bla-bla
> bla-bla
> bla[XYZ]
> importantthing
> another important thing
> [/XYZ]
> bla-bla
> bla-bla
> [XYZ]
> yet another thing
> hello!
> [/XYZ]
> bla-bla
> etc.
> $ SOMEPERLMAGIC asdf.txt> output.txt
> $ cat output.txt
> importantthing
> another important thing
> yet another thing
> hello!
>
>
> how can i sovle this question? what is SOMEPERLMAGIC? are there any perl gurus, that have a little spare time?
>
> Thank you! :\
>
>
>
>
More information about the ubuntu-users
mailing list