23,116
社区成员
发帖
与我相关
我的任务
分享
cat ceshi.txt | awk -F '|' '{if ($NF==4) print $0}'
#!/usr/bin/env python
with open('ceshi.txt', 'r') as fr: lines = filter( lambda x: len(x.split('|'))==4, fr.readlines())
with open('ceshi.txt', 'w') as fw: fw.writelines(lines)
BEGIN{
FS="|";
}
{
if (NF == 4) print $0;
}