Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


gfiler
2017-09-12T19:22:51Z
I have a semicolon delimited string I wish to convert to CRLF text format. I am using RegEx Replace but to no avail. I'm clearly missing something.

My test variable is defined as:
{REGEX(Replace|ABRAHAM_GALAVIZ_LFXLE.TIF;ABRAHAM_GALAVIZ_LGGJD.TIF;DARCIE_ALCANTARA_LG7WK.TIF;ENETHERS_BROOKS_LFXG8.TIF;HANS_RIBBECK_LGAZ1.TIF;KATHY_MCDERMOTT_LGA02.TIF;KRISTEN_BISCEGLIA_LES2C.TIF;LIDIA_PALACIOS-PINEIDA_LFFV1.TIF;LINDA_REED_LGEED.TIF;MARGARET_MEDEIROS_LGE0J.TIF|;|\r\n)}

The resulting output is:
ABRAHAM_GALAVIZ_LFXLE.TIF\r\nABRAHAM_GALAVIZ_LGGJD.TIF\r\nDARCIE_ALCANTARA_LG7WK.TIF\r\nENETHERS_BROOKS_LFXG8.TIF\r\nHANS_RIBBECK_LGAZ1.TIF\r\nKATHY_MCDERMOTT_LGA02.TIF\r\nKRISTEN_BISCEGLIA_LES2C.TIF\r\nLIDIA_PALACIOS-PINEIDA_LFFV1.TIF\r\nLINDA_REED_LGEED.TIF\r\nMARGARET_MEDEIROS_LGE0J.TIF

The RegEx replace ; with \r\n while I expected these to be true CRLF.

Any help would b appreciated.
Sponsor
Forum information
Gary_W
2017-09-13T14:42:40Z
See Thomas' post #7 in this thread: https://www.visualcron.c....aspx?g=posts&t=7062  for a .net string replace task that should do the trick. I've not had a need to use this yet, but I keep it in mind for times like this. 🙂
Jon Tofte-Hansen
2017-09-14T09:16:56Z
As REGEX(Replace) uses litterals in the replace to part, you can add a newline in the variable. Does that work in your particular case?:

{REGEX(Replace|ABRAHAM_GALAVIZ_LFXLE.TIF;ABRAHAM_GALAVIZ_LGGJD.TIF;DARCIE_ALCANTARA_LG7WK.TIF;ENETHERS_BROOKS_LFXG8.TIF;HANS_RIBBECK_LGAZ1.TIF;KATHY_MCDERMOTT_LGA02.TIF;KRISTEN_BISCEGLIA_LES2C.TIF;LIDIA_PALACIOS-PINEIDA_LFFV1.TIF;LINDA_REED_LGEED.TIF;MARGARET_MEDEIROS_LGE0J.TIF|;|
)}
Gary_W
2017-09-14T19:12:56Z
{STRING(Replace,a;b;c;d,;,
)}

Works too, no need for the regex version unless you need to do more complex matching. Too easy!
Jon Tofte-Hansen
2017-09-15T09:16:55Z
Scroll to Top