#1 2008-06-02 21:57

AbsolutRaj
Member
Registered: 2008-04-24
Posts: 5

Remove leading spaces from side of filename

Hi,

I have a huge directory of files that I am trying to rename.  Some, not all, of the files have a space at the beginning of the file name.  I'd like to remove just those spaces.  Spaces anywhere else in the file name is ok.

Thanks in advance

-Raj

Offline

#2 2008-06-02 22:37

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: Remove leading spaces from side of filename

That's easy...

A) Use RegEx rule:
Expression: \A(\s*)(.*)
Replace: $2

B) Use PascalScript:

begin
  FileName := WideTrim(FileName);
end.

Note: the second one will remove spaces from both sides of the full filename.

Offline

#3 2008-06-02 23:12

AbsolutRaj
Member
Registered: 2008-04-24
Posts: 5

Re: Remove leading spaces from side of filename

Thanks! smile

Offline

Board footer

Powered by FluxBB