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