

I have modified code so that his function can output the result for multiple detectors in one go. This maybe useful to others so I will post it here.

So just do: x, y, z = tecplot_reader('./file', 3) But in the end using np.concatenate seems better.įor the record, I created this function in order to read any file: def tecplot_reader(file, nb_var):įor idx, line in enumerate(a.readlines()): This answer was of great help for the creation of the array: and also this one for traveling the array. Solved it with the last option: arrays = Īrrays.append() I have seen np.loadtxt('./file.dat', skiprows=3) but I can't find the right options to say read all numbers and separate every 18 figures.Īlso, I started something like this with no luck: with open(file, 'r') as a:Ī = re.match(r'TITLE = (.*$)', line, re.M | re.I)ī = re.match(r'VARIABLES = (.*$)', line, re.M | re.I)Ĭ = re.match(r'ZONE (.*$)', line, re.M | re.I)ĭ = re.match(r'(.*$)', line, re.M | re.I)

I want to convert a Tecplot file into an array but I don't know how to do it.
