Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Reading a text file and formatted printing

by wardk (Deacon)
on Sep 06, 2001 at 18:47 UTC ( #110594=note: print w/ replies, xml ) Need Help??


in reply to Reading a text file and formatted printing

[id://Tas00],

you will need to of course to open() the file and read through it, here is open file and read through it 101...

open FH, "</path/to/myfilename" or die "cannot open myfilename $!\n"; while (<FH>) { # process each line which is stored in this example in $_ print $_; }

Since you want to print in columns, I suspect you will profit from learing about split() and printf() (or sprintf() )

have fun!


Comment on Re: Reading a text file and formatted printing
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2015-07-04 16:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls