Jump to content
Server Maintenance This Week. ×

Removing extra Carriage returns


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

Recommended Posts

I am trying to use the find/replace feature to eliminate user entry errors when they hit the "enter" button twice while typing in a list. I can't seem to find a way to make it find the carriage returns. - Would I have to do all of this in a calc field.

Link to comment
Share on other sites

Thank you for the quick response. I tried what you said, but it only seems to partially work. It will find the double carriage return. But, it will not replace it with a single or for that matter any other number of carriage returns. It also won't find two carriage returns if it is at the end of the field (which is the most likely place a user will put it.)

Link to comment
Share on other sites

I just have Pro and not Advanced, so I can't use the Custom function feature. I am still working on the leading and trailing carriage returns, but this eliminates all of the "middle" carriage returns.

Loop

If [“PatternCount(field, “¶¶”)>0

Set Field [“field”, “Replace(field, Position(FirstName, “¶¶”,1,1),2,” ¶”]

End If

Exit Loof If[“PatternCount(field, “¶¶”)=0”]

End Loop

Link to comment
Share on other sites

Placed after the loop in the previous post, this will take out leading and trailing carriage returns.

If [Left(field,1)=” ¶”]

Set Field[“field”, “Right( field, Length(field)-1 )”

End If

If [Right(field,1)=” ¶”]

Set Field[“field”, “Left(field, Position( field, "¶" ,1, PatternCount(field, "¶" ))-1)”]

End If

Link to comment
Share on other sites

Here's an old formula, for converting multiple paragraph returns to one. I believe it will do up to 21 consecutive. To do more, add a line with 21 (at top). I think it was Bob Weaver who not only came up with this, but who explained why it works. We no longer need it with 7/8, as we can use a Custom Function.

Substitute(Substitute(

Substitute(Substitute(InputText,

”¶¶¶¶¶¶”,”¶”),

”¶¶¶”,”¶”),

”¶¶”,”¶”),

”¶¶”,”¶”)

Link to comment
Share on other sites

I was actually going to post a question re spaces but the answer may be here

I cut and paste from emails into fields sometimes the input string has spaces at the begining or end that i dont want recorded

is this the same thing that you are talking about here?

Link to comment
Share on other sites

Ok Ithink im getting there

have got it removeing spaces but not returns

Left(test2, 8)

If [Left(test2,1)=" ¶"]

Set Field["test2", "Right( test2, Length(test2)-1 )"

End If

If [Right(test2,1)=" ¶"]

Set Field["test2", "Left(test2, Position( test2, "¶" ,1, PatternCount(field, "¶" ))-1)"]

End If

Can you spot the mistake?

Link to comment
Share on other sites

Similar to this how do you remove or replace Caridge returns in excel. see example below..

dfgdfgdfgdfgdfgdfgdfgdf

I can use the =(SUBSTITUTE((Insert Cell here),CHAR(?),CHAR(10)))

but I do not know what ascii character filemaker exports it charidge return as?

Please advise

Link to comment
Share on other sites

This topic is 6472 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.