Showing results for 
Search instead for 
Did you mean: 
Advocate I
Advocate I

I do not know how to extract data line by line from the text.

Hi, Guys.


The system sends an email in the following format.

I want to take out this line by line and process it.

Records are determined by the order of date and time, error code, ID, and message.

This is one pack of data.


2019/06/11 18:57:30 System_error_5_occurred 
2019/07/19 21:49:13 System_error_5_occurred 
2019/08/25 13:38:34 System_error_5_occurred 
2020/01/01 13:30:27 System_error_5_occurred 


However, the error code is followed by a new line.

Also, this text may be 1 line or 10 lines.In other words, it is variable.


First of all, I do not know the deletion of the line feed is in trouble.

Next, I do not know how to analyze one row at a time and repeatedly acquire data.

(Can Microsoft Flow be used as a regular expression?)


Please help me out. Thank you.

Dual Super User III
Dual Super User III

Re: I do not know how to extract data line by line from the text.

Hi @soooofunny 


Regex is currenlty not supported directly as a flow action. However, there is a premium connector and a paid service that has this action and is supported in Flow. More details here:


You can raise an idea to include the Regex feature here and you can share your comments, upvote the idea too:


Now coming to the email parsing, I see that the email is pretty structured and using some string manipulations, the data can be extracted. To start with, you can first split the body of the email over the enter key and get the lines of the email in an array and then perform further string operations on that. 


Please see a screenshot to split the body of the email at every new line here: 



Here, I am taking the body of the email, a string variable with an empty line (initialise a variable as a string and in the value part just hit an enter) and initialiseing an array variable and here i am splittign the body over the enter variable. If you are using the when an email arrives trigger, you can use the body of the trigger and split over the enter variable to get each line as an element in an array and further analyse it. 


Hope this Helps!


If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!


Advocate I
Advocate I

Re: I do not know how to extract data line by line from the text.

Hi. @yashag2255 


Thank you for teaching me a lot.

Regular expressions can only be used for paid services.

For the time being, I would like to make as much as possible with the free service.


Sorry...Though I taught you so much, I can not understand well.

Especially about the part of "Split function".

Is the usage as shown in the image wrong?



For example, such processing is assumed.

(1) "2019/06/11 18:57:30 System_error_5_occurred 525866, AABB CCD EEF FGGHH " Take out the line and go to the next process.

(2) When (1) is over, "2019/07/19 21:49:13 System_error_5_occurred Take out 535896, OOKKOOOONJJJOOOO "to the next processing.

(3) Repeat as long as there is a line.


I'm sorry to be so inquisitive.


Community Support
Community Support

Re: I do not know how to extract data line by line from the text.

Hi @soooofunny ,


Do you want to extract content from email body?


Is the email body always in the same format?


If so, please check the following thread for a reference:


we could get content from email body using WDL functions, you could know more about WDL functions at here:


Best regards,



Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advocate I
Advocate I

Re: I do not know how to extract data line by line from the text.

Hi. @v-yamao-msft .


Yes. That's right. I want to extract from the body of the mail.

It is a mail of the same format except the number of logs is different.


I checked the hyperlink destination that taught me.

I was able to pull out the "date and time" data in the way I was taught.
However, the number of records is different each time.
There are 4 lines in the sample, but there are 1 or 10 lines.
Although it is necessary to repeat, Microsoft Flow can not find a function that counts strings.
How do I get it to loop?
I'm sorry for asking you many times.



Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (7,072)