I have a big tab-delimited text file and I want to remove all rows having same values and extracting the rows having at least one different value;
File.txt
Gen1 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
Gen2 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
Gen3 1.0 1.0 1.0 5.0 0.55 1.0 1.0 1.0 1.0
Gen4 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
Gen5 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
Gen6 0.4353 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
Output.txt
Gen3 1.0 1.0 1.0 5.0 0.55 1.0 1.0 1.0 1.0
Gen6 0.4353 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
Unfortunately, I could not obtain the expected output using following commands;
perl -ne 'print if ! $a{$_}++'
Or
sort -u
or uniq
, they does not work because first column has different name.