Hello all,
I have a big problem using the command "join" with awk. I have two input files:
file1.txt
1 A
2 B
3 C
4 D
5 E
6 F
7 G
8 H
9 I
10 J
11 K
12 L
13 M
and file2.txt
2 222
5 555
6 666
6 666_2
8 888
9 999
10 101010
11 111111
13 131313
If I use the command
join file1.txt file2.txt > output.txt
within an awk script, I get the following - expected - result:
output.txt
2 B 222
5 E 555
6 F 666
6 F 666_2
8 H 888
9 I 999
10 J 101010
11 K 111111
13 M 131313
That's great!
-----8<----------------------------------------
But if I modify file2.txt and delete the entry "9", than awk ends the output after the line with the entry 8. I don't understand, why awk "forgets" the lines 10-13:
file2.txt
2 222
5 555
6 666
6 666_2
8 888
10 101010
11 111111
13 131313
The result is output.txt:
2 B 222
5 E 555
6 F 666
6 F 666_2
8 H 888
I don't know, what is the problem cause or if there is a workaround for this problem. I'm very thankful for all answers.
Reagrds
ET
I have a big problem using the command "join" with awk. I have two input files:
file1.txt
1 A
2 B
3 C
4 D
5 E
6 F
7 G
8 H
9 I
10 J
11 K
12 L
13 M
and file2.txt
2 222
5 555
6 666
6 666_2
8 888
9 999
10 101010
11 111111
13 131313
If I use the command
join file1.txt file2.txt > output.txt
within an awk script, I get the following - expected - result:
output.txt
2 B 222
5 E 555
6 F 666
6 F 666_2
8 H 888
9 I 999
10 J 101010
11 K 111111
13 M 131313
That's great!
-----8<----------------------------------------
But if I modify file2.txt and delete the entry "9", than awk ends the output after the line with the entry 8. I don't understand, why awk "forgets" the lines 10-13:
file2.txt
2 222
5 555
6 666
6 666_2
8 888
10 101010
11 111111
13 131313
The result is output.txt:
2 B 222
5 E 555
6 F 666
6 F 666_2
8 H 888
I don't know, what is the problem cause or if there is a workaround for this problem. I'm very thankful for all answers.
Reagrds
ET