I have two text files with content like this:
sum.txt
|Name |Sum |
|User A |100.0 |
|User B |40.0 |
per_proj.txt
|Name |Project |Hours |
|User A |Project 1 |50.0 |
|User A |Project 2 |30.0 |
|User A |Project 3 |20.0 |
|User B |Project 1 |20.0 |
|User B |Project 2 |20.0 |
What I'd like to achieve is to merge these two files and get output like this:
|Sum | Project 1 | Project 2| Project 3|
|User A |100.0 |50.0 |30.0 |20.0 |
| Project 1 | Project 2|
|User B |100.0 |20.0 |20.0 |
Can someone please share his/her knowledge on this one?
I was exercising with awk snippets that I found here (starting with How to merge two files using AWK?), but with no success :(