View Single Post
Old 2020-05-27, 08:39   #368
kruoli's Avatar
Sep 2017
Porta Westfalica, DE

3×83 Posts

Originally Posted by paulunderwood View Post
Unfortunately, that does not invert the order in a line. I'd propose:
grep has results.txt | cut -d' ' -f3,7 | sort | uniq | sed 's/^\([^ ][^ ]*\) \([^ ][^ ]*\)/\2 | \1/'
(I'd be using the "c" tag but that gave weird formatting, how can I escape square brackets?)

The result seems a bit chaotic, because the first column has no constant size. One could solve that using e.g. xargs and printf.
kruoli is online now   Reply With Quote