AnthonyDixon Posted July 15, 2010 Posted July 15, 2010 I have a text block field which contains lines of text separated by carriage returns and I was wondering if it was possible to remove all carriage returns that do not contain any text on a line. Thank You for any thoughts on the matter.
TheTominator Posted July 15, 2010 Posted July 15, 2010 If your field is called OriginalText, then this calc might do what you need. It works in v10. I'm not sure when TrimAll() introduced. Substitute( Substitute( TrimAll( Substitute( Substitute(OriginalText; " "; "__SPACE__"); "¶"; " "); 0; 0); " "; "¶"); "__SPACE__"; " ")
TheTominator Posted July 15, 2010 Posted July 15, 2010 If you know that the number of blank lines is relatively small, you can use the simpler Substitute(OriginalText; ["¶¶¶¶¶¶¶";"¶"]; ["¶¶¶¶¶¶";"¶"]; ["¶¶¶¶¶";"¶"]; ["¶¶¶¶";"¶"]; ["¶¶¶";"¶"]; ["¶¶";"¶"] )
AnthonyDixon Posted July 15, 2010 Author Posted July 15, 2010 Neither one seem to work for me. The calculated field showed the same result as the original text field. Thank you. I'll keep at it.
TheTominator Posted July 15, 2010 Posted July 15, 2010 Check into the possibility that the problem in the field isn't that there are blank lines from the user hitting the Return key, but the blank lines are due to the user hitting the SPACE bar so that the next visible text starts on a new line in the box. Last year I had to clean up a customer's database where that was the case. Instead of putting multiple phone numbers on separate lines with Return, the user hit the space bar multiple times after the first phone number before entering the second.
Søren Dyhr Posted July 15, 2010 Posted July 15, 2010 Now the method suggested should at least give a change in the result, and there is a more clever algorithm for this purpose. But perhaps you should attack the matter differently, since these does usually originate from a scripts deeds, and my prefered way to avoid it is for setting as well as the riddance of an element in such a list is to exploit this CF: http://www.briandunning.com/cf/39 The function simply toggles on and off for each value... --sd
bruceR Posted July 15, 2010 Posted July 15, 2010 Neither one seem to work for me. The calculated field showed the same result as the original text field. Thank you. I'll keep at it. That's impossible. At this point it would be helpful if you upload a file so we can see how you're doing this.
AnthonyDixon Posted July 15, 2010 Author Posted July 15, 2010 Definitely the return key I tested it in my sample file. Would platform have a factor? mac vs pc?
TheTominator Posted July 15, 2010 Posted July 15, 2010 No, platform is not a factor. Entering the calculation correctly does make a difference. The substitutions should have a simple pilcrow or a series of pilcrows and no special character preceding the pilcrow. Methinks your browser and/or your copy-paste functionality has thrown a monkey wrench into the works.
AnthonyDixon Posted July 15, 2010 Author Posted July 15, 2010 Boy do I feel dumb :-( Correct calcs make all the difference. Both worked just fine. Thanks a million!!
Recommended Posts
This topic is 5303 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