![](https://secure.gravatar.com/avatar/49df8cd4b1b6056c727778925f86147a.jpg?s=120&d=mm&r=g)
On Mon, 2002-08-12 at 02:00, Nils Wagner wrote:
Hi,
I have collected acceleration data by a multi-channel data acquisition system. Each file (E1431A*.DAT) contains one column with real numbers. The contents of the i-th file should be stored in the i-th row of a data matrix A. How can I manage this task efficiently ? Are there suitable python modules for this purpose ? A small example would be appreciated.
I don't know of any specific modules for this but I've done something similar with the following: import string import commands from scipy import * def read_all(basestr='E1431A*.DAT'): # this line may need to be different if you are not on UNIX. files = string.split(commands.getoutput('ls %s' % basestr)) data = [] for file in files: d = io.read_array(file) data.append(d) return Numeric.array(d)