reading data files of variable length and parameters