Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: How do i extract 3 variables from each line in a file, and print them to a new file

by bageler (Hermit)
on Jul 08, 2005 at 18:02 UTC ( [id://473518]=note: print w/replies, xml ) Need Help??


in reply to How do i extract 3 variables from each line in a file, and print them to a new file

Here is a solution without using any regular expressions:
$_="22 34808 934 20987129 83454 34643 12ms:34ms:56ms"; @f = unpack("A2A2A3A2A3A2",reverse $_); print join(',',map{join'',scalar reverse}@f[5,3,1]);

Update: didn't read the problem fully. This is an incomplete solution.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-28 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found