July 15, 201015 yr 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.
July 15, 201015 yr 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__"; " ")
July 15, 201015 yr If you know that the number of blank lines is relatively small, you can use the simpler Substitute(OriginalText; ["¶¶¶¶¶¶¶";"¶"]; ["¶¶¶¶¶¶";"¶"]; ["¶¶¶¶¶";"¶"]; ["¶¶¶¶";"¶"]; ["¶¶¶";"¶"]; ["¶¶";"¶"] )
July 15, 201015 yr Author 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.
July 15, 201015 yr 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.
July 15, 201015 yr 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
July 15, 201015 yr 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.
July 15, 201015 yr Author Definitely the return key I tested it in my sample file. Would platform have a factor? mac vs pc?
July 15, 201015 yr 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.
July 15, 201015 yr Author Boy do I feel dumb :-( Correct calcs make all the difference. Both worked just fine. Thanks a million!!
Create an account or sign in to comment