Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Match multiple lines

by zude (Scribe)
on Sep 20, 2009 at 01:00 UTC ( [id://796329]=note: print w/replies, xml ) Need Help??


in reply to Match multiple lines

Try:
my(@raw_data)=<GPXDATA>; # read file into array, one line per element splice @raw_data,0,2; # delete the first two lines

--------
~%{${@_[0]}}->{0}&&+++ NO CARRIER

Replies are listed 'Best First'.
Re^2: Match multiple lines
by Anonymous Monk on Sep 21, 2009 at 11:18 UTC
    Thank you! This is what I was able to come up with:
    use File::Find; my $dir = Cwd::getcwd(); my $string = "//Kartex TrackFil skapad av Kartex 5.4\n&KTF 2.0,sweref +99 lat long,1\n"; open (MYFILE, '>>merged.ktf'); print MYFILE $string; close (MYFILE); find(\&wanted,$dir); sub wanted { if ($_ != /\.ktf$/) { print "$File::Find::name\n"; open (KTFDATA, "$File::Find::name") || die("Could not open fil +e! $File::Find::name"); my (@raw_data) = <KTFDATA>; splice @raw_data,0,2; close (KTFDATA); open (MYFILE, '>>merged.ktf'); print MYFILE @raw_data; close (MYFILE); } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-18 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found