Question: Efficient file reading and vector/matrix assignment

I want to solve the following task efficiently. I need to read data from S files (in my case S = 50000). Each file has T rows of 5 floats each. Here T=1000 is a time index and 5 is the dimension of a dynamical system. From each file I want to read the j coordinate and to assign its T values to a column in a matrix X. At the end of this process I'll have an X array or matrix of dimension T x S. How can I do this efficiently? When I use 'readdata' in order to read the Tx5 matrix from a single file into a list D, this is a fast process. But assigning, naively, the j column from this matrix to my matrix X, using a for loop, this is an extremely slow process (it takes about 10 minutes on my computer!) It even seems to me that Maple redraws the screen each time it makes a single assignment X(k,s) = D(k,j):, where s is my file index. Note that I'm using : to supress the output. Of course, I can do this process separately by reading the data, and writing the X matrix to a file using a C code. Then, it seems that I can read efficiently from this file using 'readdata'. But is there an efficient way to do this directly using Maple? (By the way, can we do system calls in Maple?) And, related to this problem, is there a fast way to assign to a vector a column or a row from a matrix? In Matlab I can do this easily as X(:,s) = D(:,j): is there an equivalent construct in Maple? Needless to say I'm a novice in using Maple and I'd like to be able to perform these tasks effciiently so that I can start using Maple right away. THANKS!!
Please Wait...