Ich benötige eure Hilfe: Ich möchte 33 .txt datein erstellen aus der Ursprungsdatei "sub-01-run-1.txt" wobei die strings subs und runs überall ersetzt werden.
Sowas habe ich versucht.
Code: Alles auswählen
import numpy
subs= ["01", "02", "03", "04", "05", "06", "09", "10","14", "14", "16"]
runs = [1, 2, 3,]
a = open("sub-01-run-1.txt", "r")
b = a.readlines()
for i in range(len(subs)):
a = open("sub-%s.txt" %subs[i+1], "w" )
a.write(b.replace("sub-01", "sub-%s" %subs[i])
a.close()