regex - Rename all '.' to '_' in a filename except for the extension -


I am trying to create a script which is all "." Events in a file name with "_" for example, when I try to change all the symbols, I use it:

  rename 'y / / _ / '' {} 'File # test 1.2.jpg - & gt; Test_1.2.jpg   

That works fine, but when I do it "." The extension of the symbol also changes:

  Rename 'y /./_/' '{}' file # test 1.2.jpg - & gt; <1  
Itemprop = "text">

You can use a letterhead to replace all the points before the very last dot:

  rename / \. (? = [^.] *.) / _ / G '' {} '  

or using the negative eye head:

  Rename / s (?)? [^^] $) / _ / G '' {} ''    

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -