Hi everyone I am new to Fortran, I am trying to write a program to read a .txt file in which i have 24480 rows and ~ 6000 columns. In each row (as individuals) i have genotypes indicated as 1 and 2, which if, for example, in row one, i have had 204 genotypes, first half of this genotypes (=102) belongs to individual's sire and second half of genotypes belongs to individual's dam. In addition each row has not equal values. So, how can i define for Fortran to read this file row by row and divide each row to two and put beside each element (i) to the mean+i. For example i show two rows of my file as brief: row1: 112122121112122111112121111211122121111121 row2: 21112111112112222121112121211121221212121111121112 1212 And so on. Any help would be appreciated in advance.