hi i am posting as reference to prev. question extended question for previously answered awk find missing number in sequence from file1 and append to column in file2 where i want to genereate next available number in sequence after comparing as well from both files column $1,$2,$3
i tried did it like this way
awk 'NR==FNR{a[$0]=$0; next} $1 in a{print $0 && b[$NF]; next} {while(++c in b); print $0, c}' file1 file2
it just return below: just 2,3,4,5
A-5 ID2548 A550 SEQ.8232 md5 8232 71192160 COMPRESSED 5 false 0 verfied _xx 2
A-5 ID2548 A550 SEQ.8233 md5 8233 71192160 COMPRESSED 2 true 0 verfied _xx 3
B-8 ID3285 A400 SEQ.59060 md5 192 209763200 UNCOMPRESSED 1 false 0 verfied _xx 4
B-8 ID3285 A400 SEQ.59060 md5 193 262192000 COMPRESSED 16 true 0 verfied _xx 5
file1
A-5 ID2548 A550 85 S-38 COMPRESSED 1
B-8 ID3285 A400 81 B-22 UNCOMPRESSED 1
file2
A-5 ID2548 A550 SEQ.8232 md5 8232 71192160 COMPRESSED 5 false 0 verfied _xx
A-5 ID2548 A550 SEQ.8233 md5 8233 71192160 COMPRESSED 2 true 0 verfied _xx
B-8 ID3285 A400 SEQ.59060 md5 192 209763200 UNCOMPRESSED 1 false 0 verfied _xx
B-8 ID3285 A400 SEQ.59060 md5 193 262192000 COMPRESSED 16 true 0 verfied _xx
desired result:
A-5 ID2548 A550 SEQ.8232 md5 8232 71192160 COMPRESSED 5 false 0 verfied _xx 2
A-5 ID2548 A550 SEQ.8233 md5 8233 71192160 COMPRESSED 2 true 0 verfied _xx 3
B-8 ID3285 A400 SEQ.59060 md5 192 209763200 UNCOMPRESSED 1 false 0 verfied _xx 2
B-8 ID3285 A400 SEQ.59060 md5 193 262192000 UNCOMPRESSED 16 true 0 verfied _xx 3