hi dudes;
this is my file.txt:
20101228-180436_Down
a 1
b 2
...
20101228-190436_Rollback
a 1 40
e 3 20
...
20101228-180436_Down
c 2
f 2
c 1
...
and i have a down.txt:
a 1 aa 2 30 bb 1 40
b 2 ab 3 10
c 3 cd 4 50 ac 2 20
c 3 ad 1 0
d 1 af 2 10 av 3 70 ax 4 20
c 2
f 2 bt 5 20
c 1
g 3 ah 4 20 av 1 10 az 5 10
...
i want to search for down portnames in file.txt and get results from down.txt matching first two columns of it. so the result.txt must be:
20101228-180436_Down
a 1 aa 2 30 bb 1 40
b 2 ab 3 10
...
20101228-190436_Rollback
a 1 40
e 3 20
...
20101228-180436_Down
c 2
f 2 bt 5 20
c 1
...
please keep in mind that; a 1
is in both down and rollback list. so i cannot search file.txt line by line. i have to take ONLY down ports and write results next to ONLY down port list.