for x in `find -type f`; do sed -n "1{s,.*,${x##*/}\t&,p}" $x; done > output.csv for x in `find -type f`; do sed -n "1{s/.*/${x##*/},&/p}" $x; done > output.csv for x in `find -type f`; do sed -n "1{s/.*/${x:2},&/p}" $x; done > output.csv
Refer:http://bbs.chinaunix.net/thread-4152680-1-1.html
本文介绍了一种使用Shell脚本进行文件批量处理的方法,通过find和sed命令组合,实现对多个文件的内容进行搜索和替换操作,适用于需要对大量文件进行统一格式修改的场景。

1631

被折叠的 条评论
为什么被折叠?



