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 / 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,441 Super User 2025 Season 2 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,441 Super User 2025 Season 2 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

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard