对文本进行按行、内容拆分
awk ‘NR%12==1{close(p".txt");++p}{print > p".txt"}‘ file
awk ‘/index/{close(p".txt");++p}{print > p".txt"}‘ file
参考
https://github.com/jlevy/the-art-of-command-line/blob/master/README-zh.md
http://coolshell.cn/articles/9070.html
时间: 2024-11-25 10:33:29