Remove LF nonprinting character from Serial Device Output?

Running into an issue wherein one of my serial connected devices (Player Only) is preceding the desired data string with a nonprinting LF character. This does not show in Tulip Tables, but when you export to CSV and view in Excel, because of the extra character Excel skips the data in that column. Data looks like this:

2025-01-29T16:10:11Z,2025-01-29T16:10:11Z,“2025m01d29t11:10:10.000-0500 - Wagner, Lawrence [SYNNA] - (TLD)² TLD Calibration Test”,Test,“Wagner, Lawrence [SYNNA]”,2025-01-29T11:10:11-05:00,TLD000000066,03.127.016,H890938,28,"
2.786,N.m",N.m,"
2.786",2.786,2.79,Rounded Result PASSES within Service Limit Range.,2.8,2.5,2.79,2.62,2.79,2.89,2.8,3.0,Mountz EZTorQ III 50i 2306110021,2025-08-06T00:00:00-04:00,Test 8 of 8,Mountz EZTorQ III 50i 2306110021,"
2.786,N.m",“2025m01d29t11:07:15.000-0500 Wagner, Lawrence [SYNNA] (TLD)² TLD Calibration Development Version”

Is this something I could remove via expression editor?

Oddly, it is either occurring intermittently and or is related to one specific connected device, as I have some data from this device without the LF and all of the data from the other devices we’ve used doesn’t seem to have this issue.

During Tuesday morning office hours, discovered that the “missing” content was actually just hidden from view due to the LF, which definitely makes more sense from an “” escape handling perspective.


vs.

While trying to address the root cause of the device outputting this LF, I’m still looking for ways to detect the LF with regular expressions matching and then trim it, if present, ideally all within the expression editor in the existing trigger (so I don’t have to duplicate everything else in that trigger).

Why do you need to check first and why do you want to use regex?

Did you try to substitute any CRLF by an empty string?

substitute(@Variable.Variable_to_check , '
', '')

image

Not sure why I was thinking regex, but I’m still curious if there is a way I could use a regex match to alert me to the presence of nonprintable characters in my device output.

I didn’t try SUBSTITUTE() yet, but I did have success in showing variable message content depending on whether the "
" LF was present in the first character of the string.



I was starting to play with TRIM() without any arguments to see if that would work, but the output in SHOW MESSAGE seems to ignore the LF in the device output…but seems to recognize the "
" LF that I inserted into the expression text…



Next testing will be storing the IF LF then TRIM to a variable and seeing how that displays versus the message text.

Keep in mind, that trim will only apply for the beginning and the end of a string. Not for anything in between…

Good point, perhaps I’m being too narrowly focused, as the problem for the moment only occurs at the start of the string.

Does anyone have an example set of SUBSTITUTE expressions that would replace all the nonprinting characters with “”?