This is better already:
Bye,
m.
import numpy as np data = (np.loadtxt("./input.txt", dtype="int")) A= 4 B= 2 C= 5 D= 1 x = np.array(data[0:A]) y = np.array(data[A:A+B]) z = np.array(data[A+B:A+B+C]) w = np.array(data[A+B+C:A+B+C+D]) print(x,y,z,w) with open('output.txt','w') as f_out: f_out.write(f"{x}\n{y}\n{z}\n{w}\n")file.txt output:
Output:[ 5 77 1 -4]
[ 9 17]
[13 2 1 5 63]
[8]
Now I have to figure out how to get the values written in column (and not in line) and without the square brackets.Bye,
m.