I'm trying to replace all _
underscore character by -
hyphen character in all file names .mat
inside one folder. I type different versions unsuccessfully of:
rename -f 'w/_/-' *.mat
Can someone explain to me what is wrong?
I'm trying to replace all _
underscore character by -
hyphen character in all file names .mat
inside one folder. I type different versions unsuccessfully of:
rename -f 'w/_/-' *.mat
Can someone explain to me what is wrong?
If you're using a Perl-based rename
(as your tags suggest) then w
isn't a Perl regex operation.
rename -f 's/_/-/g' *_*.mat
I cannot fathom whether you are using a shell rename or the Perl rename: I can't understand your command in either context.
A Perl command-line script to rename all *.mat
files in the current directory looks like this
perl -e 'do { (my $f = $_) =~ tr/_/-/; rename $_, $f } for glob "@ARGV"' *.mat