Hi everyone,

Here is my problem:

I have different data files each with several columns and row of data.
datafile1 , datafile2, ...

Now I need to do some simple math procedure of this data files, Lets say I need to add the 3rd column of datafile1 to the 2nd column of the datafile2.

I was thinking to write a shell script that does so, but I don't have a clue where to start. Any suggestion is very appreciated.

This might be along the lines of what you were looking for.

#! /bin/bash

while : do
  read a <&4 || break
  read b <&5 || break
  set a
  set b
  echo $(($col3+$col2))
done 4<datafile1 5<datafile2

However, bash can be awkward handling multiple files. Perl or gawk would be better.