Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: skip lines

by the_hawk_1 (Scribe)
on Jul 20, 2010 at 14:56 UTC ( [id://850443]=note: print w/replies, xml ) Need Help??


in reply to skip lines

Hi halligalli,

did you tried the shift command?
Here is what I came with:

#!/usr/bin/perl use strict; use warnings; my $dest_dir = "/home/test/"; my @data = ""; my $filename = "$dest_dir/test.txt"; my @lines = ""; open(INPUT,'<'.$filename ) || die "can't open $filename \n" ; @data=<INPUT>; # Shift the lines of the header do { my $line=shift(@data); } while(!$line =~ /Parameter/); print @data; # Or play with @data as you wish, as the header is no longer in it...
Hope this can help you...
The_Hawk_1 - an ignorant monk to be...

Replies are listed 'Best First'.
Re^2: skip lines
by halligalli (Novice) on Jul 20, 2010 at 15:14 UTC
    thanks, but @data is the same like before...the header is still there

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://850443]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-25 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found