Hi all, I am new to these forum and to scripting in general for that matter. i have been looking through the forums for something that could explain my problem. I have be come pretty familiar with sed and awk but I can not seem to figure this out... I am trying to match data from 3 files but every thing I have tried doesn't seem to do what i need it to. And maybe this is something better suited for perl or python ( which i have no experience with ).. ok here goes...
Problem:
-
Want to match $1b to $2a, if match copy $2b to $4a
-
Want to match $1c to $2a, if match copy $2c to $4a (and overwrite the data in $4a)
file_a is comma seperated and has 4 fields
$1a,$2a,$3a,$4a
file_b is comma seperated and has 2 fields
$1b,$2b
file_c is comma seperated and has 2 field
$1c,$2c
Here is example of the data in the files:
berserker# more file_a
gpf135cm,gpf090079cs,purple,
gpf136cm,gpf100002cs,blue,
gpf138cm,gpf100065cs,purple,
gpf140cm,gpf110005cs,purple,
gpf141cm,gpf110037cs,purple,
gpf139cm,gpf100101cs,purple,
gpf139cm,gpf100119cs,purple,
berserker# more file_b
hou020067cs, synopsis = Urgent message file problems reported
hou090022cs, synopsis = Urgent message file problems reported
hou090056cs, synopsis = Node was detected as causing a spike by job 16811167
hou090064cs, synopsis = Node was disabled by Jeff ext8592
gpf090079cs, synopsis = Excessive ECC errors detected
gpf100002cs, synopsis = Excessive ECC errors detected
gpf090079cs,Apr 1 20:28:20 gpf090079cs kernel: MC1: CE page 0x1ac685 offset 0x240 grain 8 syndrome 0x4a row 0 channel 0 label "": bluesmoke_k8
gpf100002cs,
berserker# more file_c
gpf090079cs MC1: row 0 channel 0
So far I have figured out how to extract all this information and organize it in these files using AWK and SED, but I am not sure that I can get it to do this type of problem... Any help on this problem that i have been beating on my keyboard for would be greatly appreciated. Thank you