The "Trim Fields" node requires specifying the specific set of characters that will be removed, and it removes all of them. This is not aligned with what I understand to be the result you want.
You could solve it using the find() method and slicing:
In a Transform node it might look like this:
pipePosition = ProtocolNumber.find("|")
result = ProtocolNumber[:pipePosition]
In a :Calculate Fields" node you might do it all at once with this expression, ProtocolNumber[:ProtocolNumber.find("a")]
------------------------------
Ernest Jones
Precisely Software Inc.
PEARL RIVER NY
------------------------------
Original Message:
Sent: 09-28-2023 14:22
From: Mike Spalding
Subject: Find special character and replace it and everything after it
Hello,
I'm working with some data where a PIPE "|" has been placed in the middle of the data. I'd like to remove the PIPE along with everything after it.
Example
Field Name is ProtocolNumber
Content in field is M111-1234|2023-01-01
I want to remove the PIPE and the characters after the pipe, leaving only the M111-1234.
Can this be done using the trim fields node?
Thanks
Mike
PS. I should add that the characters leading up to the PIPE are random in length. They are not always in the format I gave as my example.
------------------------------
Mike Spalding
Abbvie Inc.
------------------------------