ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Remove everything before and after a specific word

ssripat3
Asteroide

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 RESPOSTAS 4
ShankerV
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
Pulsar

Another way. 

 

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

 

cjaneczko_0-1681745697754.png

 

ssripat3
Asteroide

Thank you for the solution @ShankerV 

Rótulos
Autores com maior número de soluções