Hi,
I am quite new to work with text-info files using awk and
I am stuck with following problem:
file one <image info> contains the following information
3001 1 5 20000 21000 2.0
3002 6 9 25000 25000 0
3003 10 14 17000 17500 0.3
...
$1 names an image
$2-$3 name image patches from the respective image$1
$4-$6 are conditions true for all image patches
I manage to create a set of files containing the patchnames within a file named like the image itself:
file <3001>: file <3002>: file <3003>: ....
1 6 10
2 7 11
3 8 12
4 9 13
5 14
But I am stuck at the point where I would need to paste in the respective information from image 3001 in file one $4-6 behind each patch number in file two.
The outcome should look as follows:
file <3001x>: file <3002x>: ....
1 20000 21000 2.0 6 25000 25000 0
2 20000 21000 2.0 7 25000 25000 0
3 20000 21000 2.0 8 25000 25000 0
4 20000 21000 2.0 9 25000 25000 0
5 20000 21000 2.0
I guess it works somehow with an awk do/while loop and grep, but wasn't able to work out how. My main problem was that the information always comes from two files, and in addition I want to "expand" my file one ...
It would be great if someone could give me a hint how to tackle this problem ... because it is far to much information to do it by hand, just something which has to be done with some logic statements.
Thanks
I am quite new to work with text-info files using awk and
I am stuck with following problem:
file one <image info> contains the following information
3001 1 5 20000 21000 2.0
3002 6 9 25000 25000 0
3003 10 14 17000 17500 0.3
...
$1 names an image
$2-$3 name image patches from the respective image$1
$4-$6 are conditions true for all image patches
I manage to create a set of files containing the patchnames within a file named like the image itself:
file <3001>: file <3002>: file <3003>: ....
1 6 10
2 7 11
3 8 12
4 9 13
5 14
But I am stuck at the point where I would need to paste in the respective information from image 3001 in file one $4-6 behind each patch number in file two.
The outcome should look as follows:
file <3001x>: file <3002x>: ....
1 20000 21000 2.0 6 25000 25000 0
2 20000 21000 2.0 7 25000 25000 0
3 20000 21000 2.0 8 25000 25000 0
4 20000 21000 2.0 9 25000 25000 0
5 20000 21000 2.0
I guess it works somehow with an awk do/while loop and grep, but wasn't able to work out how. My main problem was that the information always comes from two files, and in addition I want to "expand" my file one ...
It would be great if someone could give me a hint how to tackle this problem ... because it is far to much information to do it by hand, just something which has to be done with some logic statements.
Thanks