1833053 Members
2811 Online
110049 Solutions
New Discussion

Script help

 
SOLVED
Go to solution
George Abraham_1
Regular Advisor

Script help

Hi admins
I have a file in blocks of 6 entries each ( see the attachment).The blocks are saperated by a blank line. How to format the file such that all six fields are in one line. Then next block in second line like wise......

SessionID:sessiontype:Status

The basic idea is to find the last succesfull full backup and change the protection. If the last backup was not succesful then re run the backup.

Thanks in advance.
keep smiling
1 REPLY 1
James R. Ferguson
Acclaimed Contributor
Solution

Re: Script help

Hi George:

Here's a crude quick one:

# awk '/SessionID/ {ID=$3};/Session type/ {TYPE=$5};/Status/ {print ID":"TYPE":"$3}' inputfile

...using your supplied data, the above would output this:

2002/12/11-23:(incr):Completed/Failures
2002/12/13-17:(incr):Completed/Failures
2002/12/14-14:(incr):Completed

...

Regards!

...JRF...