Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Data extraction from text file

by Utilitarian (Vicar)
on Aug 09, 2011 at 09:49 UTC ( #919448=note: print w/replies, xml ) Need Help??


in reply to Data extraction from text file

So you want to
  • open a file
  • read a series of records from the file (No guaranteed unique field, so perhaps an array of arrays? or an array of hashes might be more suitable)
  • Print a fixed field width record from each array entry.
Have a go at coding that and get back to us with any problems you have with your Perl

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://919448]
help
Chatterbox?
[shmem]: but the results of both operations are different.
[shmem]: result := the discarded result (what's leftmost of the statement)
[shmem]: push returns the number of elements in @foo, the assignment returns all the elements in the (renewed) @foo
[Lady_Aleena]: Sanity check please? push @line, ref($list_addition ) eq 'ARRAY' ? @$list_addition : $list_addiction; # so I don't have the change existing uses of the sub.
[shmem]: $list_addiction should be $list_addition
Discipulus loose the tozzetto party!
[shmem]: .oO( addition of cookies for addiction to cookies )
[Lady_Aleena]: Other than my typos shmem. 8)
[shmem]: otherwise fine

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-04-27 11:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (503 votes). Check out past polls.