web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / extract specific text ...
Power Automate
Unanswered

extract specific text from a text file

(0) ShareShare
ReportReport
Posted on by 4

Hello everybody.

I have a text file that says the following:

xxxx ERROR: wrong date1 xxxxxxxxx ERROR: wrong date2 ERROR: wrong date 3

I need you to analyze the text and copy the following into a file:

ERROR: wrong date1
ERROR: wrong date2
ERROR: wrong date3

That is, the flow should look for every "error:" and copy the message below every time it occurs.

Can you help me, please.

Thank you.

Categories:
I have the same question (0)
  • v-bofeng-msft Profile Picture
    on at

    Hi @Berna :

    Could you describe in detail the demo of the text you provided.

    • Is there a separator between the two errors? How to tell what is "wrong date" and what is the name of error?

    At present, I can only analyze the demo you provided and get the results.
    My parsing logic is to retrieve all text that meets the following positive expression:

    ERROR: \S+ \S+

    I've made a test for you reference:

    vbofengmsft_2-1625711022032.png

    Pattern:

     

    ERROR: \S+ \S+

     

    The Result:

    vbofengmsft_1-1625710956643.png

    Best Regards,

    Bof

  • Berna Profile Picture
    4 on at

    ah you are a genius. Let me check this and I'll write you back. 

     

    I'm new in Power automate but I love it.

     

    Sorry my English.

     

    Berna.

  • Berna Profile Picture
    4 on at

    Hi how are you?

    I've been looking at the solution you gave me but I can't quite understand it.

    Below I put a screenshot of the actual text file:

     

    Berna_0-1625946837916.png

     

    What I need is for you to put all the errors you find in a file. The error can be identified by the word "ERROR CODE:"

    This is the text:

    D 3100002606 MINISTRY OF SECURITY 63,840.00 001 001 52 $ 00140999800001420001721307 2021/07/07 R
    000 ERROR CODE: 206 ERROR DESC: INVALID CREDIT CBU

    I would need the result to be the following:

    ERROR CODE: 206 ERROR DESC: INVALID CREDIT CBU

    I also take the opportunity to ask you where I can learn the meaning of the "\ S +" commands and the like.

    Thanks so much for the help.

  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @Berna :

    Please try this:

    vbofengmsft_0-1626057978502.png

    (?<=000)[a-zA-Z :.]*ERROR[a-zA-Z0-9 :.]*

    The Result:

    vbofengmsft_1-1626058008167.png

    Best Regards,

    Bof

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard