markgoz has asked for the wisdom of the Perl Monks concerning the following question:
I would just like to format this file with a script so that the output looks like as follows:answer-group mark.example.com owner "example" type vip answer-add 10.0.0.1 name mark1.example.com weight 1 answer-add 10.0.0.2 name mark2.example.com weight 1 answer-add 10.0.0.3 name mark3.example.com weight 1 answer-group jeff.example.com owner "example" type vip answer-add 10.0.0.9 name jeff1.example.com weight 1 answer-add 10.0.0.15 name jeff2.example.com weight 1
I have been testing this out using "while" or "foreach" loops while also using "split" to get the specific IP and/or example.com names, but I cannot get the script to output the data in the same line while reading from a filehandle. Any help here would be appreciated.mark.example.com,10.0.0.1,10.0.0.2,10.0.0.3 jeff.example.com,10.0.0.9,10.0.0.15
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Format lines in a File to be outputted in a different sequence
by Kenosis (Priest) on Jan 23, 2014 at 19:09 UTC | |
|
Re: Format lines in a File to be outputted in a different sequence
by toolic (Bishop) on Jan 23, 2014 at 19:09 UTC | |
|
Re: Format lines in a File to be outputted in a different sequence
by kcott (Archbishop) on Jan 24, 2014 at 12:51 UTC | |
|
Re: Format lines in a File to be outputted in a different sequence
by Anonymous Monk on Jan 27, 2014 at 10:55 UTC |