Skip to content
Advertisement

How to append a column for the result set in shell script

I need a script for the below scenario. I am very new to shell script.

JavaScript

the above query results with following result

JavaScript

Now I need to get result as follows: 1st column, 3rd column ,4th column of above result set and new column with default values

JavaScript

Here the last column values is always known values i.e for file1 DF.tx1 and file2 DF.rb2.

If the give filenames in any order the default values should not change.

Please help me to write this script. Thanks in advance!!

Advertisement

Answer

You can use awk:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement