Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

REGEX: Fetching multiline data into one cell between two identifiers

faran_ahmed
7 - Meteor

Simple query. I have tried multiline capture on regex101.com with below code, showing perfect result as I want but the same code isn't working in Alteryx.

 

^\s+:B2:(\n?.+\n?.+\n?.+\n?.+\n?).+\s+:RB:

 

I need everything between two identifiers :B2: to :RB: as present in the text input, parsing through a REGEX script. The number of content lines may vary from 2 to 5, that's used \n? as new lines may be optional, till :RB: is found, the trap should be stopped. below is the data, green being the content to be captured:

 

BANK LIMITED
Mackinnons Building SS Chundrigar
Road, CITY
:B2:
x0x0x0x0x0x0x0x0x0x0x0x0x0x0x
1* 2* 3* 4* 5* 6* JOHN SMITH
CAVALRY GROUND 52ND FLOOR, 39 COMMER
CIAL AREA 54600 CITY COUNTRY
:RB:SWIFT
:PD:8xxxxx159 NC-22/006/
:SRINF:/NATID/1172289-4/
/CONTINFO/92|MY@NIMBUS.DD/
:PPC:SUPP
:RGINF:/RESCNO/RTGS
E3M2xxxxxxxx471
SEQ-00001

17 REPLIES 17
faran_ahmed
7 - Meteor

Thanks for the reply .. but I can't concatenate whole of the data. Instead, I want to parse it using REGEX expression to have it better working with my full workflow. You know of any reason why /n is not responding in Alteryx, but responding on REGEX101.com. Thanks

binuacs
21 - Polaris

@faran_ahmed Something like this?

 

binuacs_0-1655112260891.png

 

faran_ahmed
7 - Meteor

Thanks for it. But Alteryx doesn't seem like reacting to \n ... any idea about it dear?

faran_ahmed
7 - Meteor

That won't also work for me. I do need the content in one cell ... but data in my single text file with similar structure may come around hundreds of times. I don't think concatenating everything at once would be fruitful while combining with my other regex expression parts.

binuacs
21 - Polaris

@faran_ahmed your entire data is in the below format ?

 

BANK LIMITED
Mackinnons Building SS Chundrigar
Road, CITY
:B2:
x0x0x0x0x0x0x0x0x0x0x0x0x0x0x
1* 2* 3* 4* 5* 6* JOHN SMITH
CAVALRY GROUND 52ND FLOOR, 39 COMMER
CIAL AREA 54600 CITY COUNTRY
:RB:SWIFT
:PD:8xxxxx159 NC-22/006/
:SRINF:/NATID/1172289-4/
/CONTINFO/92|MY@NIMBUS.DD/
:PPC:SUPP
:RGINF:/RESCNO/RTGS
E3M2xxxxxxxx471
SEQ-00001

faran_ahmed
7 - Meteor

There would be so many different things ... but whenever :B2: would come in it, there will always be :RB: after 3-5 lines in exact format.

So this format will keep on repeating after every few hundreds of lines.

grazitti_sapna
17 - Castor

Hi @faran_ahmed, are you looking to achieve this?

 

grazitti_sapna_0-1655115066513.png

 

grazitti_sapna_1-1655115104388.png

grazitti_sapna_2-1655115112986.png

 

 

 

 

 

If so then let me know I will explain the process along with the workflow.


Thanks!

Sapna Gupta
binuacs
21 - Polaris

@faran_ahmed Can you try with the below workflow

 

binuacs_0-1655116516723.png

 

Labels