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

Replace a Comma and Space With Carriage Return?


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

Recommended Posts

Posted

I have one field in a table which has many different values (text) separated by commas and a space. In order to be able to search each value in that field seperately, I need to replace the comma and space with a carriage return.

Thus, instead of seeing:

Dog, Cat, Rabbit

I need to use find/replace to give me:

Dog

Cat

Rabbit

Can anyone tell me how to do this?

Posted

You can write a loop script to do this, but if you want to do this only like one time then you can do a simple 'Replace Field Contents' by clicking in the field and then going into the Record Menu. Replace by calculation.

Substitute ( TrimAll (FieldA; 1 ; 3 ); ","; ¶)

Posted

Just a note about TrimAll() parameters:

The first parameter, trimSpaces, can be 0. You only need to set trimSpaces to 1 when you're dealing with text containing both Roman and CJK characters. "CJK" is Chinese, Korean and Japanese. "Roman" is everything else.

The second parameter, trimType, should also be 0 in this case. Setting trimType to 3 will remove ALL spaces in the text. For example, the above formula will take "Rabid Dog, Cat, White Rabbit" and return "RabidDog¶Cat¶WhiteRabbit".

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