文件夹中有许多类似文件,如:
CGEMS_BreastCancer.CG-B01-08012.CS-B01-02413.ind
CGEMS_BreastCancer.CG-B01-08012.CS-B01-02414.ind
CGEMS_BreastCancer.CG-B01-03616.CS-B01-00340.ind
CGEMS_BreastCancer.CG-B01-07623.CS-B01-01667.ind
CGEMS_BreastCancer.CG-B01-07625.CS-B01-02202.ind
CGEMS_BreastCancer.CG-B01-07628.CS-B01-02203.ind
现在需要把以'.'为分隔符的第二域,如:“CG-B01-08012”中“08012”相同的文件名提取出来以便做删除。
- ls >123
- awk -F[-.] 'NR==FNR{a[$4]++}NR>FNR&&a[$4]>1' 123 123
阅读(995) | 评论(0) | 转发(0) |