Page 1 of 1

Remove extension from filename

Posted: July 18th, 2018, 6:45 am
by ronnymees
Hello,

I need to remove the extension from the filename.

I tried with this, but it won't work.
I still get the full filename.

Any suggestions ?

Code: Select all

[MeasureAppName1]
Measure=Plugin
Plugin=FileView
Path=[MeasureAppsFolder]
Type=FileName
Index=1
RegExpSubstitute=1
Substitute="^(.{1,}) . (.{1,})+$" : "\1"

Re: Remove extension from filename

Posted: July 18th, 2018, 9:46 am
by balala
ronnymees wrote:I need to remove the extension from the filename.

I tried with this, but it won't work.
I still get the full filename.

Any suggestions ?
In the posted Substitute option, the first (.{1,}) expression should have to mean the name of the file and the second one, its extension. The .{1,} means that the name of the file should have to have from one character up to how many? You didn't add the second number, which would be the upper limit of the number of letters. But you don't even have to, .* means any number of letters.
The dot (.) which separates the file name and extension is a reserved character in regular expressions and you have to escape it, through a backslash (\).
And finally there are two, probably unneeded spaces, before and after the dot.
Taking into account all these, try the following Substitute option: Substitute="^(.*)\.(.*)$":"\1".