Join 3 files using key column in a mapping file
I'm new of UNIX shell scripting. I'm recently generating a excel report in UNIX(file with delimiter is fine). How should I make a script to do it?
1 file to join comes from output of one UNIX command, the second from another UNIX command, and third from a database query. The key columes of all these 3 files come from a mapping file. It's basically as following:
MappingFile:
===========
job1 a_name1
job2 c_name2
job3 b_name3
job4 e_name4
file1_toJOIN:
============
b_name3 12:00:03 15:00:09
e_name4 10:30:00 11:00:00
c_name2 09:40:00 10:12:00
a_name1 22:00:00 23:00:00
file2_toJOIN:
=============
job2 tom 22
job1 dan 18
job4 jim 25
job3 kim 20
the spreadsheet format to generate:
===========================
job1 22:00:00 23:00:00 01:00:00 dan 18
......
Appreciate your help!
|