Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: newbie need help with a simple code

by LanX (Bishop)
on Mar 05, 2013 at 01:27 UTC ( #1021731=note: print w/replies, xml ) Need Help??


in reply to newbie need help with a simple code

unclear, do you need certain columns or certain rows?

using split should help in both cases

DB<108> $line='ATOM 1287 O LYS B 65 49.675 57.571 62.721 1.00 31.87 +O' => "ATOM 1287 O LYS B 65 49.675 57.571 62.721 1.00 31.87 O" DB<109> @col =split / /,$line => ( "ATOM", 1287, "O", "LYS", "B", 65, "49.675", "57.571", "62.721", "1.00", "31.87", "O", ) DB<110> @col[1..3,5] => (1287, "O", "LYS", 65)

Cheers Rolf

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1021731]
help
Chatterbox?
and the monks are mute...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2017-11-19 10:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (279 votes). Check out past polls.

    Notices?