Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
243 views
in Technique[技术] by (71.8m points)

database - 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!

question from:https://stackoverflow.com/questions/65878294/convert-text-data-into-x-y-arrays

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

(input: "Size: ")

followed by

https://delim.co/#

to get exactly what I needed.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...