Hello all,
This is what the goal is:
Sample File 1:
hp14
#J3010 ;SPOOL ;UNISPOOL.SYS ;$STDLIST;LP ;4 ; 0; 198;18/07/02;17:37;18/07/02;:42;
tstb0300 ; ; ;#O27756 ;LP ;#;
#J3339 ;SR261C03;MANAGER.SYS ;$STDLIST;LP ;4 ; 0; 72;18/07/02;17:38;18/07/02;18:42;
tstb0300 ; ; ;#O28112 ;LP ;#;
#J3340 ;SR214C03;MANAGER.SYS ;$STDLIST;LP ;4 ; 0; 1773;18/07/02;17:41;18/07/02;18:42;
tstb0300 ; ; ;#O28113 ;LP ;#;
#J3342 ;SR260C03;MANAGER.SYS ;$STDLIST;LP ;4 ; 0; 131;18/07/02;17:43;18/07/02;18:43;
tstb0300 ; ; ;#O28115 ;LP ;#;
End of File Sample 1_____________
What I need help on is getting certain items in the above file sample report into another report that will be legible and under their appropriate columns. Note that I have associated the data from the above sample report to where the columns (they will be columns in the final report) are next to the column titles below. Example, Number 1 below is Job Number this will be a column in the final report and under this column, I need to have #J7258 under it and so on..
The output file will have these columns in it:
- Job Number = (#J7258)
- Job Name = (GW268D08)
- User Name = (MGR.MRSHIC08)
- File Name = ($STDLIST)
- Device = (LP)
- Device Type = (4)
- Priority = (0)
- Lines = (8)
- Creation Date On SrcSystem = (07/31/04)
- Time = (00:59)
- Date Close = (07/31/04)
- Time Close = (01:00)
- Src System = (mrsh0800)
- System = ( ) on the above report this is left blank but not always.
- Spool Flag = ( ) on the above report this is left blank but not always.
- Spool File ID = (#0394809)
- Src Device = (LP)
- Src Spool Id = (#03948097)
------------end----------------------------------------
This is what I have so far and it isn't working too well.. If you can help, that would be greatly appreciated..
----code snipit---------------------------------------
awk 'BEGIN {
FS=";"
frmt="|%-13s|%-16s|%-18s|%-10s|\n"
printf frmt, "Job Number", "JobName", "User Name", "File Name"
}
NR==22 {
box=$1
}
/^#J[0-9]{4}/ {
job=$2
user=$3
getline
getline
id=$4
printf frmt, box, job, user, id
} ' file1
-----end of script snipit---------------------------
Hope this message makes sense, please ask if it doesn't. Again, all help will be greatly appreciated..