I want to do tsv file processing using awk, Here's my input:
scaffold1 1 100
scaffold1 101 200
scaffold1 201 300
scaffold2 1 100
scaffold2 201 500
scaffold3 10 500
scaffold4 10 300
Desired_output:
Feature scaffold1
1 100
101 200
201 300
Feature scaffold2
1 100
01 500
Feature scaffold3
10 500
Feature scaffold4
10 300
I tried using uniq and sort and also awk for printing uniq of first column using command
awk '!seen[$1]++ Input.txt
but it prints all unique values from first column and then i can print rest of the columns, but i want to print first unique value and rest columns in the next line, as shown above.
Please tell me is there a way to do this?