Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Assigning values. Simple and Nasty one.

by pearlie (Sexton)
on Apr 19, 2005 at 10:44 UTC ( #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? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2023-01-28 23:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?