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

3×83 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
-f7,3
Unfortunately, that does not invert the order in a line. I'd propose:
Code:
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