Need help on a shell script that do the following.
Inputs
A file A that contains the following.
PHP Code:
OA ABC02
Blade #7 Status:
Unit Identification LED: On
OA ABC02
Blade #1 Status:
Unit Identification LED: Blinking
OA BCA03
Blade #2 Status:
Unit Identification LED: On
OA CDE03
Blade #10 Status:
Unit Identification LED: On
--------------------------------------------
A file B that contains the following
PHP Code:
[B]ABC02[/B]
a120
a2g2
a32s
a45e
a53a
a6ea
a74r
a8rd
a9df
a10d
a11d
a12r
a13r
[B]BCA03[/B]
b1aa
b11a
b14a
b5ds
b67d
b7ds
b8df
b9gh
b10g
b11f
b12e
b13f
[B]CDE03[/B]
c165
c277
c377
c433
c323
c090
c434
c832
c844
c145
c133
c132
c153
I now need to replace the number that comes after the # (Blade #7 Status) on the first file by the name on the 7th line after the heading (ABC02)of that paragraph in the second file.
So that the final output should read.
OA ABC02
Blade #a74r Status:
Unit Identification LED: On
OA ABC02
Blade #a120 Status:
Unit Identification LED: Blinking
OA BCA03
Blade #b11a Status:
Unit Identification LED: On
OA CDE03
Blade #c145 Status:
Unit Identification LED: On
Any help would be highly appreciated