|
我有很多这样的数据文件
Variables: 8169 [Fix: 1, Binary: 8068, Integer: 100]
Objective nonzeros : 128
Linear constraints : 2217 [Less: 2069, Equal: 148]
Nonzeros : 4434
RHS nonzeros : 148
Indicator constraints: 7758 [Less: 3694, Equal: 2143, Greater: 1921]
Nonzeros : 15516
RHS nonzeros : 7610
我想提取"Binary: "和", General"之间的8068,或者
Indicator打头行里的"[Less: "和", Equal:"之间的3694
类似这种数据。用什么写脚本最简单?
如果能忽略模式匹配之后字符串里的空格和'\t'就更好了。
比如提取出" \t8068 "这个字符串,前后各有一个空格和一个'\t',
能去掉非数字的字符,最终转换成"8068"。 |
|