Extract specific values from txt files in Pyroot

So let’s say I have 20 .txt files with almost similar names like data20.txt, data30.txt etc.
Every file has 5 values in it like: 1 2 3 4 5
I want to get the first value from every file and fill them into a array so I get plot them later on. I know how to do the plot, I just don’t know how to get the arrays. Can someone help me with that?

Hi @rollerstop,
this looks more like a python(?) question than a ROOT question. I wasn’t sure how to do this off the top of my head, but a quick google got me this stackoverflow question, hopefully it applies to your case! :smile: