比如现有数据a.txt name data
1 am 10
2 bi 4
3 ct 6
4 gu 7
5 el 8
。
。
。
想要读取name为“bi”,“el”的每行数据,怎么办?假设有很多行,并且不知道name对应的行数
得到
name data
2 bi 4
5 el 8
这个结果