Averaging 3 files with multiple rows

Hi,

I am trying to average the values from 3 files with the same format. They are very large files so I will describe the file and show some it of. Basically the file has 83 columns (with nearly 7000 rows). The first three columns are the same for each file while the remaining 80 are values that differ (the ones I want averaged).

The file is tab separated.

The file looks like this:

File 1 (only showing 4 of the 80 columns and 1 row):

#geneid	strand	feature_type	up.1	        up.2	        up.3	        up.4
AAC1	        -	      CDS	                -0.383672	-0.470544	-0.024423	-0.179893

File 2 (format is the same as above but values differ):

#geneid	strand	feature_type	up.1	        up.2	        up.3	        up.4
AAC1	        -	        CDS	                -0.45433	-0.560544	-0.114423	-0.174582

File 3 (format is the same but values differ):

#geneid	strand	feature_type	up.1	        up.2	        up.3	        up.4
AAC1	        -	        CDS	                -0.283672	-0.570544	-0.624423	-0.669893

Output file (average values):

#geneid	strand	feature_type	up.1	        up.2	        up.3	        up.4
AAC1	        -	        CDS	                -0.373891	-0.533877	-0.254423	-0.341456

The file has many rows so there is a ton of averaging. Thanks

Kyle

Thread closed - continue here