FindAndReplace - How can I use this twice and not showing the data twice.

72 views
Skip to first unread message

Sarah Magat

unread,
Oct 8, 2018, 10:40:37 PM10/8/18
to XMPie Interest Group
Hi, I tried to do this the code below.. it worked but the Content inside the Description show it twice.. because I used it twice right?.. So what I need is just to show it once but do the find and replace twice?
I hope you get me.. 

FindAndReplace(@{Entry_Description}, "\r\r", "\r") + FindAndReplace(@{Entry_Description}, "\r", "\n")

Sarah Magat

unread,
Oct 8, 2018, 10:42:47 PM10/8/18
to xmpie...@googlegroups.com
Sorry it should replace first the single \r to \n then find and replace the double \r\r to single \r

--
You received this message because you are subscribed to the Google Groups "XMPie Interest Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmpie-users...@googlegroups.com.
To post to this group, send email to xmpie...@googlegroups.com.
Visit this group at https://groups.google.com/group/xmpie-users.
For more options, visit https://groups.google.com/d/optout.

west-digital.fr

unread,
Oct 9, 2018, 12:48:19 AM10/9/18
to XMPie Interest Group
Try this:

FindAndReplace( FindAndReplace( @{Entry_Description}, "\r\r", "\r"), "\r", "\n")

However, as you can see, it will change all double carriage returns into a single one, then change all single carriage returns (including the pair of carriage returns generated from your former double carriage returns) into a line feed. Is this really what you want to achieve?

It you want to change all double carriage returns into a single one, and change all single carriage returns (but not the former doubles) into a line feed, you may try something this like:

FindAndReplace( FindAndReplace( FindAndReplace( @{Entry_Description}, "\r\r", "sarahmagat"), "\r", "\n"), "sarahmagat", "\r")

Message has been deleted

Sarah Magat

unread,
Oct 12, 2018, 3:48:50 AM10/12/18
to xmpie...@googlegroups.com
Hi guys,

I tried all your suggestions but this is the result. I make a notes "Must be \r". The second image is the original one that I need to tidy up from feed.

image.png

image.png


On Tue, Oct 9, 2018 at 1:07 PM neilh <neilhe...@gmail.com> wrote:
Perform your second find/replace on the results of the first:

Findandreplace(
 FindAndReplace(@{Entry_Description},"\r","\n")  ,"\r\r","\r")

west-digital.fr

unread,
Oct 13, 2018, 9:46:07 AM10/13/18
to XMPie Interest Group
Neil"s post was deleted from the forum. Maybe Neil saw after posting that his first"\r" > "\n" replacement would make the second replacement never applied (as all "\r" are already replaced, so no instance of "\r\r" is left). Never mind...
I can't easily understand what you want to achieve against your data.
Attached please find an example, which you can adapt to your context and goal.

Carriage Return & Line Feed processing.cpkg
Reply all
Reply to author
Forward
0 new messages