cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Dual Super User
Dual Super User

Re: Split multiple lines and return a particular text

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

4 REPLIES 4
Highlighted
Dual Super User
Dual Super User

Re: Split multiple lines and return a particular text

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

Highlighted
Frequent Visitor

Re: Split multiple lines and return a particular text

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?

Highlighted
Dual Super User
Dual Super User

Re: Split multiple lines and return a particular text

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

Highlighted
Post Prodigy
Post Prodigy

Re: Split multiple lines and return a particular text

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,760)