database - 在 MSQ 数据中查找 MILL
问题描述
我有看起来像的数据
121,736,52,0,5.295,0.000,70.000,3,1.0000,3,1
122,736,52,0,5.295,0.000,70.000,3,1.0000,3,1
123,736,52,0,5.295,0.000,70.000,3,1.0000,3,1
124,736,52,1,5.295,1.000,70.200,3,1.0000,3,1
124,736,52,OIND,70.200,27.641,-np-
125,736,52,1,5.295,1.000,72.175,3,1.0000,3,1
125,736,52,OIND,72.175,308.340,MILL
129,736,52,1,5.295,1.000,70.525,3,1.0000,3,1
129,736,52,OIND,70.525,76.211,MILL
我需要存储以“MILL”或“-np-”结尾的所有数据,然后需要将其放入新的 MSQ 文件中
任何建议 语言是 TCL
解决方案
就像是
set in [open yourfile r]
set out [open newfile w]
while {[gets $in line] >= 0} {
if {[regexp {(?:MILL|-np-)$} $line]} {
puts $out $line
}
}
close $in
close $out
推荐阅读
- html - 列填充:自动;没有高度溢出div
- java - 对 MongoDB 的 java 驱动程序中的重复唯一键错误做出反应
- javascript - 检查 Cloud Firestore 查询是否返回某些内容
- javascript - 在javascript中将数组声明为函数是什么意思?
- php - 登录后不跳转
- excel - 调用宏时如何修复溢出错误
- filter - Tableau:使用聚合进行筛选
- python - Tensorflow 使用 cpu (tensorflow) 与 gpu (tensorflow-gpu) 后端显示不同的行为
- typescript - Intellisense 表示 Class1 和 Class2 中不存在该属性
- python - 在 Python 中清理后保存数据帧