Getting data from one string

Hi all

I scrape some data which comes as one string

Here is an example of that data

Name Jordan
Address Oxford Road
Post Code NG56 5LK
Country England

There are no commas or other special characters and the string will always contain ‘Name’ ‘Address’ Post Code’ ‘Country’

I’d like to build a generic component that allows you to pass in the string and two inputs and an output

The two inputs would your chosen start text and chosen end text and the output would be the data between those inputs

So if I chose ‘Name’ as start text and ‘Address’ as end text, it would return ‘Jordan’
If I chose ‘Address’ as start text and ‘Post Code’ as end text, it would return ‘Oxford Road’

Please can I ask if anybody can help me with the ‘code’ I would need to achieve this?

Thanks
Jordan

Use string manipulation
Split Function
Cheers. @jordrowley

Use Input dialogue Box for two inputs for getting text in between them
Then use assign
OutPutTxt=FullText.split({Input1.tostring},StringSplitOptions.None(1).trim.Split({Input2.Tostring},StringSplitOption.None(0).trim)

Hi @jordrowley

Use match activity and give the pattern like this

(?<=Name).*

Thanks
Ashwin.S

Regex.xaml (5.3 KB)

This looks the business, thank you. Will use it now :slight_smile:

I did wonder about regex as an alternative, thank you :slight_smile:

Works fine, thank you, appreciate it :slight_smile:

Hey @ImPratham45

I can’t quite get your string to work. I’ve used the same variable names, please can you see where I am going wrong? I’ve inclued a screenshot, and xmal if any help

Thanks
Jordan

Textfromastring.xaml (3.7 KB)

Main.xaml (4.4 KB)
check this hope u will get idea
or try this
Extract Text Between Labels.xaml (9.7 KB)

1 Like

Thank you so much. Both really good and thank you also for the website recommendation :slight_smile:

Jordan

Happy Automation !
Have a nice day :blush::+1:

1 Like

You too, thank you again :slight_smile:
Jordan

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.