Loading

AWK批量改名awk -F- '{printf "mv \"%s\" \"%s-%s%s\"\n", $0, $1,$4,$5}' a.txt > b.txt

awk -F- '{printf "mv \"%s\" \"%s-%s%s\"\n", $0, $1,$4,$5}' a.txt > b.txt

 

多个分隔符:

awk -F'[【.-]' '{printf "mv \"%s\" \"%s-%s.%s\"\n", $0, $1,$3,$7}' a.txt > b.txt

 最后一列取法:

awk -F'[【.-]' '{printf "mv \"%s\" \"%s-%s.%s\"\n", $0, $1,$3,$NF}' a.txt > b.txt

 

posted @ 2024-04-14 10:12  stono  阅读(4)  评论(0编辑  收藏  举报