replacing np.fromregex by less memory demanding readlines calls