Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4671 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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)]

Posted

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

Posted

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!

This topic is 4671 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.