#!/bin/bash #用途: #1.当前目录的txt文件批量转csv #2.制表符转逗号分隔符 #3.NULL去除 #4.删除WARN警告 for i in `ls ./*.txt` do sed -e 's/ /,/g' -e 's/NULL//g' -e '/^WARN:/d' $i >$i.csv done
#!/bin/bash #用途: #1.当前目录的txt文件批量转csv #2.制表符转逗号分隔符 #3.NULL去除 #4.删除WARN警告 for i in `ls ./*.txt` do sed -e 's/ /,/g' -e 's/NULL//g' -e '/^WARN:/d' $i >$i.csv done