It is currently May 5th, 2024, 5:34 am

How to delete an empty #CLRF#

Get help with creating, editing & fixing problems with skins
gkmaz9
Posts: 67
Joined: August 26th, 2019, 10:42 am

How to delete an empty #CLRF#

Post by gkmaz9 »

Code: Select all

[outPut1]
meter=String
MeasureName=1Hour1
MeasureName2=1Hour2
MeasureName3=1Hour3
MeasureName4=1Hour4

DynamicVariables = 1 

Text=%1#CRLF#%2#CRLF#%3#CRLF#%4


'MeasureName1' 'MeasureName2' is filled Now
'MeasureName3' 'MeasureName4' is empty Now
('MeasureName3' 'MeasureName4' can be filled later)

[current result]
------------------------
A
A


------------------------

I'd like to erase the two empty Enter(#CLRF#s)
Is there any good way?
(For example, change substitute=#@%@%^$^#)

[result to want]
------------------------
A
A
------------------------
Last edited by gkmaz9 on August 28th, 2019, 6:40 pm, edited 1 time in total.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to delete an empty #CLRF#

Post by jsmorley »

I would add this to each of the WebParser "child" measures:

Code: Select all

RegExpSubstitute=1
Substitute="(?siU)^(.+)$":"\1#CRLF#"
Then just have the Text option on the String meter be:

Text=%1%2%3%4

The #CRLF# will only be added if the value of the child measure is not an empty string.
gkmaz9
Posts: 67
Joined: August 26th, 2019, 10:42 am

Re: How to delete an empty #CLRF#

Post by gkmaz9 »

Thank you very much! :D
I never thought of adding crlf to WebParser.
You're a genius.