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

Re: Assigning values. Simple and Nasty one.

by pearlie (Sexton)
on Apr 19, 2005 at 10:44 UTC ( [id://449174]=note: print w/replies, xml ) Need Help??


in reply to Assigning values. Simple and Nasty one.

If you know the delimiter between the two columns and its fixed, you can use the "split" method in perl to extract the column values as follows:  @arr = split(/delimiter/,$_); Now the array "arr" contains all column values in 1 line of the file. Then you can print  $arr[0] and  $arr[1]. More can be elaborated on this if you specify the exact format of the file. Please go through perl documentation of split. That will make things far more clear.

Replies are listed 'Best First'.
Re^2: Assigning values. Simple and Nasty one.
by Anonymous Monk on Apr 19, 2005 at 10:50 UTC
    Thank you very much for your help. The delimeter is the whitespace and two columns contains numbers.
      So just go ahead and try using split. If it does not work, please post the code here.
      A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

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

    No recent polls found