I have a txt file contains a count with text description:
12 CASH
10 Tree
7 Computer Desk
Ideally I'd like to end up with
| CASH | 12 |
| Tree | 10 |
| Computer Desk | 7 |
I tried this awk statement below, which kind of works, but then I lose anything after the first word of the description. I feel like I should be using sed, but I'm struggling to come up with a workable solution.
awk '{ print "|" $2 "|" $1 "|" }' temp.txt
Result:
| CASH | 12 |
| Tree | 10 |
| Computer | 7 |