Quantcast
Viewing all articles
Browse latest Browse all 186

The problem of matching consecutive cross-line strings

I have a file named "s0.log",There's a lot of this structure in there:Image may be NSFW.
Clik here to view.
enter image description here

You can see that the strings "Alpha occ.eigenvalues --" and "Alpha virt.eigenvalues --" will be contiguous.

There are many similar structures in the file, and my current need is to find the data in the last one of these structures

Clear["Global`*"];(*set current dir*)SetDirectory[  NotebookDirectory[]  ];s0Log = Import["https://vip.123pan.cn/1812087188/tmp/Mathematica/s0.log", \{"Text", "Lines"}]

I don't know how to match this situation of consecutive lines, I consulted ChatGPT and checked the regular expression, but I still don't know how to deal with it


Viewing all articles
Browse latest Browse all 186

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>