Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: multi-line (string doc) parsing

by 2501 (Pilgrim)
on Jan 27, 2001 at 23:53 UTC ( [id://54779]=note: print w/replies, xml ) Need Help??


in reply to multi-line (string doc) parsing

here is a quickie if the file is broken up by spaces. I am not wildly happy with it, because you have to assume that sharename and type don't have spaces in them. hell, I tried, it works, it just ain't the best.:)
use strict; while(<DATA>){ if($_ =~ /^\s+(\S+)\s+(\S+)\s+(.+)\s+$/){ print "$1\t$2\t$3\t\n"; } } __DATA__ Sharename Type Comment --------- ---- ------- IPC$ IPC Remote IPC Server Comment --------- ------- STUFF Stuff

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (7)
As of 2024-03-29 15:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found