I have several txt files "file_i.txt" that look like this:
id, size, price, colour
1, 2, 10, black
2, 8, 5, blue
...
All the files contain those fields, but the fields order may be different.
I would like to sort every file based on two features, price first and then size. I know it is possible to use the command sort to sort on two fields in this way:
sort -k2,3 -k1,2 file_i.txt
However, as the field position is different in every file, is there a way to sort based on the field name instead?
Thanks