I have two files:
file1 has the format:
field1;field2;field3;field4
(file1 is not initially sorted)
file2 has the format:
field1
(file2 sorted)
I run the following two commands:
sort -t\; -k1 file1 -o file1 # to sort file 1 join -t\; -1 1 -2 1 -o 1.1 1.2 1.3 1.4 file1 file2
I get the following message:
join: file1:27497: is not sorted: line_which_was_identified_as_out_of_order
Why is this happening?
(I also tried to sort file1 based on the entire line, not only the first line of the line, but without success)
sort -t\; -c file1 sort -t\; -c file1 does not output anything. Around line 27497, the situation is really strange, which means that sorting is not doing its job correctly:
XYZ113017;... line 27497
source share