I'm trying to draw disk data from a text file to be used in an analysis program. The data from the file comes from the output of a Linux command free -m
and looks like this:
total used free shared buffers cached
Mem: 7976 6459 1517 0 865 2248
-/+ buffers/cache: 3344 4631
Swap: 1951 0 1951
I want to extract the 6 numbers on the second row using regex in Python and put them either in another file, send them directly to a program's input, or simply just put their values into variables, but I'm a bit rusty with regex logic and syntax. Any pointers?