Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 ( #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.
  • Comment on Re: How do i extract 3 variables from each line in a file, and print them to a new file
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2021-06-20 01:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (93 votes). Check out past polls.

    Notices?