tweetiepooh has asked for the wisdom of the Perl Monks concerning the following question:
Creating the tree I've just about figured out, probably not the best solution but I think it works. The problem now is taking the data from the file and writing it out to a set of flat files in this tree.
The data looks like
There maybe one or more data entry on each line.(host,,) (host-1,,) (host-1.domain,,) (host_234,,) or (,user,) (,user,)
I need to convert this to
Now using reg-ex coach on a PC I came up withdata data data ...
But this only gets the first data item in Perl.s/\W*([\w._-]+)\W+/$1\n/g
A pointer would be jolly helpful. I've searched a bit but can't quite see what I need.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Process netgroup file with a regex
by Velaki (Chaplain) on Aug 23, 2006 at 16:57 UTC | |
by tweetiepooh (Hermit) on Aug 23, 2006 at 17:21 UTC | |
by Velaki (Chaplain) on Aug 23, 2006 at 18:20 UTC |