Wickerman Posted February 9, 2012 Posted February 9, 2012 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
doughemi Posted February 9, 2012 Posted February 9, 2012 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)]
Lee Smith Posted February 9, 2012 Posted February 9, 2012 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
Wickerman Posted February 9, 2012 Author Posted February 9, 2012 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now