Join the Alteryx Community’s Maveryx Summer Cup event! Compete, network with others, and earn your gold through a series of challenges from July 24th to August 11th. Learn more about the event here.

Alteryx Designer Desktop Discussions

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

Remove everything before and after a specific word

ssripat3
8 - Asteroid

Hello community,

 

I am currently getting a response from a API and I use Text to Columns to convert the data into the below format.

 

DownloadHeadersJSON_NameJSON_ValueString

HTTP/1.1 200 Connected

HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Transfer-Encoding: chunked
Content-Type: application/json;odata=verbose;charset=utf-8
Content-Encoding: gzip
Expires: Sun, 02 Apr 2023 14:13:58 GMT

d.NameABC.csv
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Transfer-Encoding: chunked
Content-Type: application/json;odata=verbose;charset=utf-8
Content-Encoding: gzip
Expires: Sun, 02 Apr 2023 14:14:03 GMT
Last-Modified: Mon, 17 Apr 2023 14:14:03 GMT
d.NameDEF.csv
HTTP/1.1 200 OK
Cache-Control: private, max-age=0
Transfer-Encoding: chunked
Content-Type: application/json;odata=verbose;charset=utf-8
Content-Encoding: gzip
Expires: Sun, 02 Apr 2023 14:14:08 GMT
Last-Modified: Mon, 17 Apr 2023 14:14:08 GMT
d.NameGHI.csv

 

DownloadHeadersJSON_NameJSON_ValueString
HTTP/1.1 200 OKd.NameABC.csv
HTTP/1.1 200 OKd.NameDEF.csv
HTTP/1.1 200 OKd.NameGHI.csv

 

I would like to get rid of anything other than HTTP/1.1 200 OK from the DownloadHeaders column. The objective here is to send an email with the filenames only when DownloadHeaders is HTTP/1.1 200 OK is present.

 

Thank you

 

4 REPLIES 4
ShankerV
17 - Castor

Hi @ssripat3 

 

One way of doing this.

 

ShankerV_0-1681745349763.png

 

(.{0,})(HTTP/1.1 200 OK)(.+)

 

ShankerV_0-1681745395363.png

 

 

Input was:

ShankerV_1-1681745453954.png

 

Many thanks

Shanker V

PhilipMannering
16 - Nebula
16 - Nebula

If the objective is to send emails when you have a 200 OK, then just filter with,

Contains([DownloadHeaders], '200 OK')

 

cjaneczko
13 - Pulsar

Another way. 

 

IF Contains([DownloadHeaders], 'HTTP/1.1 200 OK') THEN 'HTTP/1.1 200 OK' ELSE '' ENDIF

 

cjaneczko_0-1681745697754.png

 

ssripat3
8 - Asteroid

Thank you for the solution @ShankerV 

Labels