I am trying to import data using python / numpy.loadtxt. With most data, this is not a problem, for example. if the line looks like this:
0.000000 0.000000 0.000000 0.000000 -0.1725804E-13
In this case, I can use the space as a separator. Unfortunately, the program that produces the data does not use separators, but only a fixed column width (and I cannot change this). Example:
-0.1240503E-03-0.6231297E-04 0.000000 0.000000 -0.1126164E-02
Is it possible to indicate to numpy.loadtxt several times that each column has 14 characters? I would prefer not to modify files created by another program manually ...
EDIT:
It seemed to me that I share a very simple solution based on the dxwx suggestion. In this example, I decided that the solution would be
a = numpy.genfromtxt('/path/to/file.txt', delimiter = 14)
An extra space appeared in front of the first column in my real data, and I did not want to use the last column and the last row. Now it looks like this:
a = numpy.genfromtxt('/path/to/file.txt', delimiter = (1,14,14,14,14,14,14), usecols = range(1,6), skip_footer = 1)
Thanks everyone for the quick reply.