Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Best tool for extracting text

JamesEOS
5 - Atom

Hi,

 

I have data strings like the below

 

{'gender': 'Female', 'nationality': 'IRL', 'document_type': 'passport', 'date_of_expiry': '2024-05-14', 'issuing_country': 'IRL'}

 

And I am looking to organise the data into columns that will show the parameter and result. However there are sometimes missing or extra fields like the below

 

{'document_type': 'driving_licence', 'issuing_country': 'CHE'}

 

What would be the best tool to scrape this data?

 

Thanks

3 REPLIES 3
BrandonB
Alteryx
Alteryx

I think that a couple of text to columns tools should make things easy. One to split to rows on a comma delimiter, and a second to parse on the colon delimiter. Workflow is attached for reference. 

 

parsing2.png

JamesEOS
5 - Atom

Thanks, hadn't thought of doubling up text to columns!

jdunkerley79
ACE Emeritus
ACE Emeritus

One other option given the structure of your data is to replace the ' with " and then you can use JSON Parse:

jdunkerley79_0-1604997454523.png

 

Obviously has a problem if there are extra " or ' in the data.

 

But does give a nice parsed output:

jdunkerley79_1-1604997524006.png

 

 

Labels
Top Solution Authors