Reputation: 520
suppose file has contents as
A=abc, B=fl, C=asd
A=59, B=sadl, C=asd
A=ab40c, B=sad, C=asd
i did a grep and got some lines from it, not i need to display it in this format
A B C
abc fl asd
59 sad1 asd
or
A | B | C
abc | fl | asd
59 | sad1 |asd
kinda?
bad thing is with the grep, i have uniq-c,sort -rn also which displays occurence in reverse order, now i need to get this field also in table under count
like this
count | A | B | C
3 | abc | fl | asd
5 | 59 | sad1 |asd
everything's working except displaying it in table format(main thing) any idea?
Upvotes: 0
Views: 3736
Reputation: 121387
echo tt | sed "s/[ABC=,]//g" file_name | column -t
You can use 'echo' to print column headers A B C if needed.
Upvotes: 3