How to remove all extra spaces in filename?

A swapping-ground for Regular Expression syntax

How to remove all extra spaces in filename?

Postby jwilcock » Wed Aug 29, 2018 3:22 pm

Would like to replace all instances of multiple white space in a file name with a single space. With "\s{2,}" in the match field and a single space in the replace field of RegEx, it just replaces the whole filename with a single space, not each instance of multiple spaces. Where am I going wrong? Help appreciated. Thanks!
jwilcock
 
Posts: 1
Joined: Wed Aug 29, 2018 12:08 am

Re: How to remove all extra spaces in filename?

Postby therube » Wed Aug 29, 2018 3:55 pm

5:Remove -> D/S
therube
 
Posts: 437
Joined: Mon Jan 18, 2016 6:23 pm

Re: How to remove all extra spaces in filename?

Postby therube » Wed Aug 29, 2018 4:02 pm

(This) RegEx works (I'm going to say) on the concept of demarcated fields.
Not sure how you would go about here?

sed or vim are different, where you can do something like; s/\s\{2,\}/ /g & have it work.
therube
 
Posts: 437
Joined: Mon Jan 18, 2016 6:23 pm

Re: How to remove all extra spaces in filename?

Postby tryingcake » Wed Dec 05, 2018 10:30 pm

Postby therube » Wed Aug 29, 2018 3:55 pm

5:Remove -> D/S


I cannot get this to work. I'm obviously missing something. When I do it, it merely removes all Ds and Ss from the filename. Can you give me a step by step for dummies, please?
tryingcake
 
Posts: 2
Joined: Wed Dec 05, 2018 10:22 pm

Re: How to remove all extra spaces in filename?

Postby therube » Thu Dec 06, 2018 1:56 am

D/S

Is one of the checkboxes in the 5:Remove dialog section.

"D/S" does not get entered into the 'Chars' box - unless you want to remove the characters; d, /, & s.
therube
 
Posts: 437
Joined: Mon Jan 18, 2016 6:23 pm

Re: How to remove all extra spaces in filename?

Postby tryingcake » Thu Dec 06, 2018 3:38 am

Thank you. I was missing to check mark D/S. Thanks!
tryingcake
 
Posts: 2
Joined: Wed Dec 05, 2018 10:22 pm


Return to Regular Expressions