Skip to main content
added 104 characters in body
Source Link

I nailed it:

awk '!a[$2]++ && !b[$3]++' input.txt | 
    awk '{print $4"\t"$5"\t"$3}' > output.txt

awk '!a[$2]++ && !b[$3]++' input.txt | cut -f 4,5 > first_part.txt

tac input.txt | awk '!a[$2]++ && !b[$3]' | tac | cut -f 6 > second_part.txt

paste first_part.txt second_part.txt > output.txt

but if you have fancier solutions, do not hesitate to share!

I nailed it:

awk '!a[$2]++ && !b[$3]++' input.txt | 
    awk '{print $4"\t"$5"\t"$3}' > output.txt

but if you have fancier solutions, do not hesitate to share!

I nailed it:

awk '!a[$2]++ && !b[$3]++' input.txt | cut -f 4,5 > first_part.txt

tac input.txt | awk '!a[$2]++ && !b[$3]' | tac | cut -f 6 > second_part.txt

paste first_part.txt second_part.txt > output.txt

but if you have fancier solutions, do not hesitate to share!

added 18 characters in body
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718

I nailed it: awk '!a[$2]++ && !b[$3]++' input.txt | awk '{print $4"\t"$5"\t"$3}' > output.txt

awk '!a[$2]++ && !b[$3]++' input.txt | 
    awk '{print $4"\t"$5"\t"$3}' > output.txt

but if you have fancier solutions, do not hesitate to share!

I nailed it: awk '!a[$2]++ && !b[$3]++' input.txt | awk '{print $4"\t"$5"\t"$3}' > output.txt

but if you have fancier solutions, do not hesitate to share!

I nailed it:

awk '!a[$2]++ && !b[$3]++' input.txt | 
    awk '{print $4"\t"$5"\t"$3}' > output.txt

but if you have fancier solutions, do not hesitate to share!

Source Link

I nailed it: awk '!a[$2]++ && !b[$3]++' input.txt | awk '{print $4"\t"$5"\t"$3}' > output.txt

but if you have fancier solutions, do not hesitate to share!