I have 3 text files as emp id.txt, before sal.txt, now sal.txt. Contents of these 3 files :-
emp id.txt
emp id ----- 1 4 7 10 13 16 19
before sal.txt
before sal ----- 23 56 78 97 105 123 145
now sal
now sal ---- 25 60 82 99 109 124 150
I used below in the shell script
awk '{ for (i=1; i<=NF; i++) RtoC[i]= (RtoC[i]? RtoC[i] FS $i: $i) } END{ for (i in RtoC) print RtoC[i] }'
to convert from Row to Column then I got output like -
1 23 25
4 56 60
7 78 82
10 97 99
13 105 109
16 123 124
19 145 150
emp before now
id sal sal
--- ----- ----
But I want output in the below format like-
--------------------------------
|emp id |before sal | now sal |
|--------|---------- | --------|
|1 | 23 | 25 |
|4 | 56 | 60 |
|7 | 78 | 82 |
|10 | 97 | 99 |
|13 | 105 | 109 |
|16 | 123 | 124 |
|19 | 145 | 150 |
--------------------------------
Could you please help me on this so that i can able to get the output in above format.