I have a text file as shown below:
A f1
B f2
A f3
B f4
B f5
I want to sort it based on first column values and keep it in separate files.
Desired output:
A.txt:
A f1
A f3
B.txt:
B f2
B f4
B f5
Tried it with uniq but itβs not working.
Edit: I am not able to post the desired way the txt file and output file should be, but it should one below in next lines