hi, guys: I have a question on how to read data from file in which the length of each line is unfixed. For instance, the data in sample.dat are: 1 2 3 4 5 6 7 8 I want to read this kind of data into a matrix as: 1 2 3 4 5 6 7 0 8 0 0 0 Thank you Jianbing Wu