February 9, 201213 yr I have inherited a field with multiple values in it, and sometimes the first line is empty -- in other words, the first character in the field is a carriage return: ¶ How can I simply strip out gratuitous leading (and for that matter trailing) ¶ 's ? I'm thinking there's maybe something like Trim(text) for carriage returns -- or how do I seek and destroy these pesky characters? Thanks
February 9, 201213 yr In a script: Replace Field Contents [No dialog; YourTable::YourText; If(Left(YourTable::YourText;1) = "¶"; Right(YourTable::YourText; Length(YourTable::YourText)-1); YourTable::YourText)] Replace Field Contents [No dialog; YourTable::YourText; If(Right(YourTable::YourText;1) = "¶"; Left(YourTable::YourText; Length(YourTable::YourText)-1); YourTable::YourText)]
February 9, 201213 yr I like this Custom Function by Ray Cologon called Trim4. http://www.briandunning.com/cf/166 for things like this. The script would look like this Go to Record / Request / Page [ First ] Loop Set Field [ YourLayout::YourFiels ;Trim4 ( YourLayout::YourFiels )] Go to Record / Request /Page [ Next ; Exit after last ] End Loop
February 9, 201213 yr Author Wow-- thanks to you both for your responses -- the Trim4 function works great, and the more mechanical approach doughemi provided is rurally helpful to me because that's the "kind of thing" I was figuring I had to do and now I've got a nice example of how to manipulate leading/trailing data in a field. Love this place!
Create an account or sign in to comment