How do I average column values from a tab-separated data file, ignoring a header row and the left column?
问题 My task is to compute averages from the following data file, titled Lab1_table.txt : retrovirus genome gag pol env HIV-1 9181 1503 3006 2571 FIV 9474 1353 2993 2571 KoRV 8431 1566 3384 1980 GaLV 8088 1563 3498 2058 PERV 8072 1560 3621 1532 I have to write a script that will open and read this file, read each line by splitting the contents into an array and computer the average of the numerical values ( genome , gag , pol , env ), and write to a new file the average from each of the