cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PrashantCFC1
Frequent Visitor

Split multiple lines and return a particular text

Hello,

Could someone tell me how can I get only a particular information from a text field using the split function. For example, I have a text field which contains multiple lines as such :

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

Enectus et netus et malesuada fames ac turpis egestas

 

I want to get only the data of the second line (from "Excepteur" to "laborum") and not anything after. How do I do this using the split function?

Thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
RezaDorrani
Dual Super User II
Dual Super User II

Hi @PrashantCFC1 

 

ClearCollect(colnew, Split(Textfield.Text,Char(13)));

 

Last(FirstN(colnew,3)).Result - this should give you the result

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

5 REPLIES 5
RezaDorrani
Dual Super User II
Dual Super User II

Hi @PrashantCFC1 

 

ClearCollect(colnew, Split(Textfield.Text,Char(13)));

 

Last(FirstN(colnew,3)).Result - this should give you the result

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Hi @RezaDorrani ,

Thanks for your suggestion. However, the above text was just an example. The number of characters are unknown in each line. In that case would I be able to split by line?

Hi @PrashantCFC1 

 

Yes it would

As long as you have the same pattern

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Hi @RezaDorrani 

I'm having problem using split function:

I have this label1.text that contain text:
"(01)00884450005156(17)220228(10)K1527906"

text3.png

I want to split it by the bracketed number and store into 3 different label.

 

ie:

label1.text = 00884450005156

label2.text = 220228
label3.text = K1527906

I also try to use the split function like this on label3.text, but it give error: Expected Text Value.
Split(Label.Text, "(10)").Result

What should i do?

Can you help me?

Thanks,

pytbyt

@PytByt  You're better off looking at the IsMatch and related functions.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (25,562)