Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Data extraction with specific keywords

by thanos1983 (Parson)
on Jan 19, 2018 at 11:26 UTC ( [id://1207511]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Data extraction with specific keywords
in thread Data extraction with specific keywords

Hello neeraj_kr,

Welcome to the Monastery. I am bit confused here. I am not sure through your code sample and description what you are trying to do.

Can you copy a few lines of input as a sample, and create a sample (hard-coded) of the desired output. I mean for example you have input:

0 2:-0.5795 3:0.33582025 4:55.8255 5:65.316997 6:15 7:16 8:57 9:28 10: +29 11:23 12:5 13:4328.520884 14:5279.218852 15:7434.371708 16:7829.12 +6536 17:7560.24877 18:7380.518025 19:7094.262906 20:6916.621367 21:61 +98.40255 22:11858.88819484 23:15547.317962699 24:23174.9885578928 25: +26259.9933684153 26:26163.2825969745 27:26115.0415561043 28:25798.425 +8540249 29:24623.253542266 30:23630.8474599248

Desired output would be:

2:-0.5795 3:0.33582025 21:6198.40255 23:15547.317962699

Something like that, of course the sample above it is just an example but at least to give us a direction of what you are trying to do.

Update: Based on your sample of code above your data is ' ' space separated but on your code you split the data with \t. Which one is the correct?

Looking forward to your update, BR.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-03-28 18:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found