bash - Remove duplicates (both lines) and duplicate only based on a sub-string -


maybe can me following problem.

i use:

cat file1 file2 | sort -t} -k2 | less 

the output contains duplicates when comparing starting position 5 in line

a01} value1 = 5000000000 b01} value1 = 5000000000 a01} value2 = 6000000000 b01} value2 = 7000000000 

how can remove these both lines:

a01} value1 = 5000000000 b01} value1 = 5000000000 

completely output?

the result should be:

a01} value2 = 6000000000 b01} value2 = 7000000000 

i assume want sort/uniq using fields key 2 (value) key 4 (the number). field 1 skipped when invoking uniq:

cat file1 file2 |sort -k 2,4 |uniq --skip-fields=1 --unique 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -