Hi all, I have a config file that contains some text as below:
server01 :/u01/app/oracle/admin/db01/adump :*.dmp,5 :compress :/bin/gzip server01 :/u01/app/oracle/admin/db04/adump :*.aud,5 :remove :/bin/rm server01 :/u01/app/oracle/admin/db06/adump :*.log,5 :remove :logrotate But am wanting to run a script that will take this file as an input and produced the following output: server01 :/u01/app/oracle/admin/db01/adump :*.dmp,5 :compress :/bin/gzip server01 :/u01/app/oracle/admin/db04/adump :*.aud,5 :remove :/bin/rm server01 :/u01/app/oracle/admin/db06/adump :*.log,5 :remove :logrotate Can anyone advise how is the best way to be able to format the text so that they lined up neatly? Perhaps anyone already have a script that does what am wanting to do? At the moment, am doing it manually reading one line at a time and using awk and printf using the max string of each column as the basis for the max length of the column for each field. Am wanting to be able to use Perl instead. Any feedback much appreciated. Thanks in advance.