Hope this is helpful to somebody: m = Length@Import["/path/to/file/datos.dat", "Lines"] (* # lines in file *)