Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Reading data from file

by EdwardG (Vicar)
on Sep 15, 2004 at 14:05 UTC ( [id://391175]=note: print w/replies, xml ) Need Help??


in reply to Reading data from file

I would need to see your code to guess why data is getting lost, but in general here is how you would split these records as you require(untested):

while (my $line = <DATA>) { my @columns = split /\|/, $line; push @array1, $columns[1]; # Note the first element [0] is empty push @array2, $columns[2]; push @array3, $columns[3]; } __DATA__ |0|PA|1|||BELL|FRANCIS|D|||1||ANGORA||FLEET|HAMPSHIRE|GU51 2UA|

 

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-24 01:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found