Search code examples
databasematplotlibfeature-engineering

Convert text/data into x, y arrays?


I have the following text as the output of my program:

Size: 31        Mflops/s: 355.10        Percentage: 0.79
Size: 32        Mflops/s: 370.89        Percentage: 0.83
...
Size: 767       Mflops/s: 360.15        Percentage: 0.80

and I want to get an X array = [31, 32, ... 767] and a Y array = [355.10, 370.89, ..., 360.15].

I can't copy-paste values vertically like the snippet above, so I can't extract values easily. The output comes with spaces like above.

I would then put these into matplotlib for easy plotting.

Is there an easy way to do this?

Thanks!


Solution

  • I used http://www.molbiotools.com/textextractor.html

    (input: "Size: ")

    followed by

    https://delim.co/#

    to get exactly what I needed.