我有一个像这样的文件
0: jdbc:hive2://10.241.1.8:10000/> select number,exported_at from audit group by number,exported_at order by number limit 10;
789116704,20150907T130500Z
789190212,20150907T130500Z
789255093,20150907T130500Z
789282142,20150907T130500Z
789359510,20150907T130500Z
789363793,20150907T130500Z
789363843,20150907T130500Z
789369808,20150907T130500Z
789437014,20150907T130500Z
789437071,20150907T130500Z
0: jdbc:hive2://10.241.1.8:10000/>
我只想保留数字后跟逗号的行。我的输出应该是这样的
789116704,20150907T130500Z
789190212,20150907T130500Z
789255093,20150907T130500Z
789282142,20150907T130500Z
789359510,20150907T130500Z
789363793,20150907T130500Z
789363843,20150907T130500Z
789369808,20150907T130500Z
789437014,20150907T130500Z
789437071,20150907T130500Z
我正在寻找一个sed命令,可以做这项工作。任何帮助都是非常感谢的。谢谢
最佳答案
grep -E '[0-9]+,' data.txt
其中data.txt是包含输入数据的文件