Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Extract text data

45179902
8 - Asteroid

Hello,

 

I have a text file with the following structure. I want to extract everything in Name List B. What can I do? I was looking at multi-row formula to fill down some flags than use filter to remove "remove" tagged rows, but not sure how to do it.

 

Input 

- - - - - - - - - - - - - - - - - - -

Date: 2023-03-15

Name List A

- - - - - - - - - - - - - - - - - - -

First Name | Last Name

XXX | XXX

XXX | XXX

- - - - - - - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - -

Date: 2023-03-15

Name List B

- - - - - - - - - - - - - - - - - - -

First Name | Last Name

XXX | XXX

XXX | XXX

- - - - - - - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - -

Date: 2023-03-15

Name List C

- - - - - - - - - - - - - - - - - - -

First Name | Last Name

XXX | XXX

XXX | XXX

- - - - - - - - - - - - - - - - - - -

 

Output: 

First Name | Last Name

XXX | XXX

XXX | XXX

 

These should be names starting below the row Name List B. I don't want anything else in the output.

 

Thanks,

Alteryxer

9 REPLIES 9
ShankerV
17 - Castor

Hi @45179902 

 

One way of doing this.

 

ShankerV_0-1678866591143.png

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @45179902 

 

Step 1: Input 

 

ShankerV_0-1678866705237.png

 

Step 2; 

 

ShankerV_1-1678866729628.png

 

IF [Field1]="Name List B"
THEN 100
ELSE [Row-1:Temp]+1
ENDIF

 

ShankerV_2-1678866742320.png

 

Step 3: 

 

ShankerV_3-1678866772181.png

[Temp] >= 102 AND [Temp] <= 104

 

ShankerV_4-1678866784384.png

 

Many thanks

Shanker V

45179902
8 - Asteroid

@ShankerV  Thanks for helping. Please note that the example I give is just a representation. There could be different number of names in each name list. Therefore, I'm afraid hardcoding [Temp] <= 104 cannot achieve full automation.

ShankerV
17 - Castor

Hi @45179902 

 

I believe the line

------------- will be available in the input right.

 

Many thanks

Shanker V

45179902
8 - Asteroid

Yes. The dashed lines are in the file as well. It's just that there could be two rows of names in Name List A, five rows of names in Names List B, and one row of name in Name List C, etc. I want this to achieve full automation so that no matter this variance, I can use this configuration to always extract every name rows in Name List B.

ShankerV
17 - Castor

Hi @45179902 

 

Here is full automation even if we have 4 lines, 5 lines or n number of lines.

 

ShankerV_0-1678868568632.png

 

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @45179902 

 

Step 1: Input

 

ShankerV_0-1678868634568.png

 

Step 2: 

ShankerV_1-1678868660914.png

 

 

Step 3: 

 

ShankerV_2-1678868679687.png

IF [Field1]="Name List B"
THEN 100
ELSE null()
ENDIF

 

ShankerV_3-1678868693827.png

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @45179902 

 

Step 4: Multi row formula

ShankerV_0-1678868742780.png

IF !Isnull([Row-1:Temp]) and contains([Field1],"- - -")
THEN 2
ELSEIF [RecordID]>4 and [Row-1:Temp1]=2 and !contains([Field1],"- - -")
THEN [Row-1:Temp1]
ELSE null()
ENDIF

ShankerV_1-1678868759093.png

 

Step 5;

 

ShankerV_2-1678868782839.png

ShankerV_3-1678868791063.png

 

Step 6:

 

ShankerV_4-1678868811744.png

ShankerV_5-1678868820788.png

 

Hope this helps!!!!

 

Many thanks

Shanker V

Christina_H
14 - Magnetar

Here's a way to do it with a single multi-row formula.

Christina_H_0-1678874348826.png

Labels