Linux file sort with incomplete columns -
i need sort file first column, if there numerical entry, , second column when there none in first. looks this:
3 - foo bar 1 1 foo bar - 5 foo bar 2 2 foo bar - 4 foo bar
and need output be
1 1 foo bar 2 2 foo bar 3 - foo bar - 4 foo bar - 5 foo bar
is there nice way in linux single command? thanks!
on output follows format can use basic sort command:
sort -k 1,2 foo.txt
Comments
Post a Comment