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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Search for specific te...
Power Automate
Answered

Search for specific text in textfile

(0) ShareShare
ReportReport
Posted on by 47

I have a zip-file which contains txt files. 

I want to search in each txt file if there is a piece of text thats starts with <?XML>.

If that piece of text exists in the text file, then this textfile must be delete from within the folder it was saved in. 

 

I tought that this must be the flow, but it doesn't work.

dorak1005_0-1688986630462.png

dorak1005_2-1688987097451.png

 

I tried severall flows, but i don't succeed in a successfull one. 

These jobs we have to do multitimes a day, so a goof working flow is helping a lot.

 

Please can you help me with a flow thats works.

 

Looking forward to you reply. 

With regards,

Diana

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,672 Super User 2026 Season 1 on at

    You have to unzip the files 😉

    E.g. with action "Extract archive to folder"

  • dorak1005 Profile Picture
    47 on at

    Thank you Chriddle, that part i had already solved.

     

    But in the flow above mentioned, something isn't right. 

    I know i have to get the file, get the contents, search for a piece of text in the txt file and when it exists in that file, the file must be deleted. 

    But i can't get the right flow to work with. It seems easy but that is not the case. 

  • Verified answer
    Chriddle Profile Picture
    8,672 Super User 2026 Season 1 on at

    Your condition equals(indexOf(body('get_file_content'), 'XML'), 0) is wrong.

    You don't look for file contents starting with 'XML' but<?XML>

     

    You might try equals(indexOf(body('get_file_content'), '<?XML>'), 0)

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard