Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1001 1 2
- 1002 1 2
- 1003 3 5
- 1004 6 7
- 1005 8 9
- 1002 7
- 1003 8
- 1001 5
- 1002 3
- 1002 10
- 1004 60
- 1001 102
- 1003 305
- 1005 809
- 1001 1 2 0 5 0 102
- 1002 1 2 7 3 10 0
- 1003 3 5 8 0 0 305
- 1004 6 7 0 0 60 0
- 1005 8 9 0 0 0 809
- awk 'FNR==NR{a[$1]=$2;next}{print $0,a[$1]?a[$1]:"0"}' file2 file1
- 1001 1 2 0
- 1002 1 2 7
- 1003 3 5 8
- 1004 6 7 0
- 1005 8 9 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement