It is currently September 18th, 2019, 12:13 am

How to delete an empty #CLRF#

Help with creating, editing & fixing problems with skins
gkmaz9
Posts: 20
Joined: August 26th, 2019, 10:42 am

How to delete an empty #CLRF#

gkmaz9 » August 28th, 2019, 6:07 pm

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: 19457
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: How to delete an empty #CLRF#

jsmorley » August 28th, 2019, 6:15 pm

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: 20
Joined: August 26th, 2019, 10:42 am

Re: How to delete an empty #CLRF#

gkmaz9 » August 28th, 2019, 6:28 pm

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