I am new to awk. I have two files and need to combine parts of each file into one by lining up a column in each.
file1
ZOLT:;
LOADING PROGRAM VERSION 6.16-0
SIGNALLING LINK LOAD
ACTIVE UNIT
METERS OF LAST PERIOD: 15:00:00 - 15:30:00 (30 MIN)
TDM BASED LINKS:
================
RECEIVED TRANSMITTED
LINK ERLANGS ERLANGS
==== ========== ===========
0 0.254 0.238
1 0.257 0.222
2 0.073 0.070
3 0.073 0.071
4 0.063 0.038
5 0.063 0.038
7 0.076 0.123
9 0.075 0.090
10 0.073 0.070
11 0.073 0.070
12 0.074 0.069
13 0.077 0.090
14 0.251 0.180
15 0.053 0.051
16 0.079 0.077
20 0.052 0.051
21 0.054 0.050
22 0.052 0.050
23 0.036 0.035
24 0.037 0.035
25 0.076 0.091
26 0.076 0.089
28 0.240 0.201
29 0.029 0.043
30 0.076 0.125
file2
ZNEL;
LOADING PROGRAM VERSION 8.27-0
SIGNALLING LINK STATES
LINK TERM LOG EXTERN INTERN BIT
LINK LINK SET STATE UNIT TERM FUNCT TERM PCM-TSL PCM-TSL RATE
==== ======== ======= ===================================================
0 16 FSTP1 AV-EX CCSU-2 1 1 0 590-01 198-01 56
1 17 FSTP2 AV-EX CCSU-0 1 2 0 696-01 190-02 56
2 18 BFM01 AV-EX BSU-0 1 15 0 592-01 174-15 64
3 18 BFM01 AV-EX BSU-1 1 15 0 656-01 178-15 64
4 19 HLR01 AV-EX CCSU-0 1 8 1 576-01 190-08 64
5 19 HLR01 AV-EX CCSU-2 1 5 1 694-01 198-05 64
7 34 FTMS1 AV-EX CCSU-0 1 7 2 623-01 190-07 64
8 34 FTMS1 UA-INS CCSU-2 1 4 3 687-01 198-04 64
EXCHANGE TERMINAL INACTIVE
9 42 BFM02 AV-EX BSU-0 1 14 1 596-01 174-14 64
10 18 BFM01 AV-EX BSU-1 1 14 1 565-01 178-14 64
11 18 BFM01 AV-EX BSU-0 1 13 2 660-01 174-13 64
12 18 BFM01 AV-EX BSU-1 1 13 2 598-01 178-13 64
13 42 BFM02 AV-EX BSU-0 1 12 3 631-24 174-12 64
14 17 FSTP2 AV-EX CCSU-2 1 0 8 680-01 198-00 56
15 57 BSY01 AV-EX BSU-0 1 11 5 679-24 174-11 64
16 57 BSY01 AV-EX BSU-0 1 10 4 578-24 174-10 64
17 - UA-AD CCSU-2 1 6 5 527-24 198-06 64
SIGNALLING LINK NOT IN SIGNALLING LINK SET
18 57 BSY01 UA-INS BSU-1 1 12 5 675-24 178-12 64
19 66 HYANN AV-EX CCSU-0 1 1 7 527-01 190-01 56
20 57 BSY01 AV-EX BSU-1 1 11 4 575-24 178-11 64
21 57 BSY01 AV-EX BSU-0 1 9 6 589-24 174-09 64
22 57 BSY01 AV-EX BSU-1 1 10 6 585-24 178-10 64
23 18 BFM01 AV-EX BSU-0 1 8 7 639-01 174-08 64
24 18 BFM01 AV-EX BSU-1 1 9 7 661-01 178-09 64
25 42 BFM02 AV-EX BSU-1 1 8 8 607-24 178-08 64
26 42 BFM02 AV-EX BSU-0 1 7 8 670-24 174-07 64
27 42 BFM02 UA-INS BSU-0 1 6 9 641-24 174-06 64
28 16 FSTP1 AV-EX CCSU-0 1 0 4 698-01 190-00 56
29 72 GDI01 AV-EX BSU-1 1 7 14 900-24 178-07 64
30 34 FTMS1 AV-EX CCSU-2 1 3 7 622-01 198-03 64
This is how I would like output
file3
LINK,SET,LINK,R-ERLANGS,T-ERLANGS
0,FSTP1,0,0.254,0.238
1,FSTP2,1,0.257,0.222
2,BFM01,2,0.073,0.07
3,BFM01,3,0.073,0.071
4,HLR01,4,0.063,0.038
5,HLR01,5,0.063,0.038
7,FTMS1,7,0.076,0.123
8,FTMS1,,,
9,BFM02,9,0.075,0.09
10,BFM01,10,0.073,0.07
11,BFM01,11,0.073,0.07
12,BFM01,12,0.074,0.069
13,BFM02,13,0.077,0.09
14,FSTP2,14,0.251,0.18
15,BSY01,15,0.053,0.051
16,BSY01,16,0.079,0.077
17,UA-AD,,,
18,BSY01,,,
19,HYANN,,,
20,BSY01,20,0.052,0.051
21,BSY01,21,0.054,0.05
22,BSY01,22,0.052,0.05
23,BFM01,23,0.036,0.035
24,BFM01,24,0.037,0.035
25,BFM02,25,0.076,0.091
26,BFM02,26,0.076,0.089
27,BFM02,,,
28,FSTP1,28,0.24,0.201
29,GDI01,29,0.029,0.043
30,FTMS1,30,0.076,0.125
Middle link column could be removed. I just left it there to show the matching columns. If anyone has any ideas how to do this please let me know.
file1
ZOLT:;
LOADING PROGRAM VERSION 6.16-0
SIGNALLING LINK LOAD
ACTIVE UNIT
METERS OF LAST PERIOD: 15:00:00 - 15:30:00 (30 MIN)
TDM BASED LINKS:
================
RECEIVED TRANSMITTED
LINK ERLANGS ERLANGS
==== ========== ===========
0 0.254 0.238
1 0.257 0.222
2 0.073 0.070
3 0.073 0.071
4 0.063 0.038
5 0.063 0.038
7 0.076 0.123
9 0.075 0.090
10 0.073 0.070
11 0.073 0.070
12 0.074 0.069
13 0.077 0.090
14 0.251 0.180
15 0.053 0.051
16 0.079 0.077
20 0.052 0.051
21 0.054 0.050
22 0.052 0.050
23 0.036 0.035
24 0.037 0.035
25 0.076 0.091
26 0.076 0.089
28 0.240 0.201
29 0.029 0.043
30 0.076 0.125
file2
ZNEL;
LOADING PROGRAM VERSION 8.27-0
SIGNALLING LINK STATES
LINK TERM LOG EXTERN INTERN BIT
LINK LINK SET STATE UNIT TERM FUNCT TERM PCM-TSL PCM-TSL RATE
==== ======== ======= ===================================================
0 16 FSTP1 AV-EX CCSU-2 1 1 0 590-01 198-01 56
1 17 FSTP2 AV-EX CCSU-0 1 2 0 696-01 190-02 56
2 18 BFM01 AV-EX BSU-0 1 15 0 592-01 174-15 64
3 18 BFM01 AV-EX BSU-1 1 15 0 656-01 178-15 64
4 19 HLR01 AV-EX CCSU-0 1 8 1 576-01 190-08 64
5 19 HLR01 AV-EX CCSU-2 1 5 1 694-01 198-05 64
7 34 FTMS1 AV-EX CCSU-0 1 7 2 623-01 190-07 64
8 34 FTMS1 UA-INS CCSU-2 1 4 3 687-01 198-04 64
EXCHANGE TERMINAL INACTIVE
9 42 BFM02 AV-EX BSU-0 1 14 1 596-01 174-14 64
10 18 BFM01 AV-EX BSU-1 1 14 1 565-01 178-14 64
11 18 BFM01 AV-EX BSU-0 1 13 2 660-01 174-13 64
12 18 BFM01 AV-EX BSU-1 1 13 2 598-01 178-13 64
13 42 BFM02 AV-EX BSU-0 1 12 3 631-24 174-12 64
14 17 FSTP2 AV-EX CCSU-2 1 0 8 680-01 198-00 56
15 57 BSY01 AV-EX BSU-0 1 11 5 679-24 174-11 64
16 57 BSY01 AV-EX BSU-0 1 10 4 578-24 174-10 64
17 - UA-AD CCSU-2 1 6 5 527-24 198-06 64
SIGNALLING LINK NOT IN SIGNALLING LINK SET
18 57 BSY01 UA-INS BSU-1 1 12 5 675-24 178-12 64
19 66 HYANN AV-EX CCSU-0 1 1 7 527-01 190-01 56
20 57 BSY01 AV-EX BSU-1 1 11 4 575-24 178-11 64
21 57 BSY01 AV-EX BSU-0 1 9 6 589-24 174-09 64
22 57 BSY01 AV-EX BSU-1 1 10 6 585-24 178-10 64
23 18 BFM01 AV-EX BSU-0 1 8 7 639-01 174-08 64
24 18 BFM01 AV-EX BSU-1 1 9 7 661-01 178-09 64
25 42 BFM02 AV-EX BSU-1 1 8 8 607-24 178-08 64
26 42 BFM02 AV-EX BSU-0 1 7 8 670-24 174-07 64
27 42 BFM02 UA-INS BSU-0 1 6 9 641-24 174-06 64
28 16 FSTP1 AV-EX CCSU-0 1 0 4 698-01 190-00 56
29 72 GDI01 AV-EX BSU-1 1 7 14 900-24 178-07 64
30 34 FTMS1 AV-EX CCSU-2 1 3 7 622-01 198-03 64
This is how I would like output
file3
LINK,SET,LINK,R-ERLANGS,T-ERLANGS
0,FSTP1,0,0.254,0.238
1,FSTP2,1,0.257,0.222
2,BFM01,2,0.073,0.07
3,BFM01,3,0.073,0.071
4,HLR01,4,0.063,0.038
5,HLR01,5,0.063,0.038
7,FTMS1,7,0.076,0.123
8,FTMS1,,,
9,BFM02,9,0.075,0.09
10,BFM01,10,0.073,0.07
11,BFM01,11,0.073,0.07
12,BFM01,12,0.074,0.069
13,BFM02,13,0.077,0.09
14,FSTP2,14,0.251,0.18
15,BSY01,15,0.053,0.051
16,BSY01,16,0.079,0.077
17,UA-AD,,,
18,BSY01,,,
19,HYANN,,,
20,BSY01,20,0.052,0.051
21,BSY01,21,0.054,0.05
22,BSY01,22,0.052,0.05
23,BFM01,23,0.036,0.035
24,BFM01,24,0.037,0.035
25,BFM02,25,0.076,0.091
26,BFM02,26,0.076,0.089
27,BFM02,,,
28,FSTP1,28,0.24,0.201
29,GDI01,29,0.029,0.043
30,FTMS1,30,0.076,0.125
Middle link column could be removed. I just left it there to show the matching columns. If anyone has any ideas how to do this please let me know.