0

From the example, the name of the processor is returned but with a space at the end, how can I make it return a value without a space in the end?

[MeasureRun]
Measure=Plugin
Plugin=RunCommand
Parameter=wmic cpu get Name
OutputType=ANSI
RegExpSubstitute=1
Substitute="Name.*#CRLF#":"","#CRLF#":""
ClipString=1
IfCondition=1
IfTrueAction=[!CommandMeasure MeasureRun "Run"]

[MeterResult]
Meter=String
MeasureName=MeasureRun
FontSize=14
FontColor=255,255,255,255
AntiAlias=1
Text=%1!

Look at the image

I think this can be done through regular expression, but I'm not strong at it.

Emma
  • 27,428
  • 11
  • 44
  • 69
Pavel Fedorov
  • 153
  • 1
  • 2
  • 9

1 Answers1

0

Just add another Substitute in the substitution list to replace the occurence of one or more whitespaces from the end of the string (the pattern "\s+$") with an empty string like below:

Substitute="Name.*#CRLF#":"","#CRLF#":"","\s+$":""
ecle
  • 3,952
  • 1
  • 18
  • 22