cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jakson
Resolver I
Resolver I

Count occurrences of a character in a string

I've got a billion (not literally) files to iterate over and I keep finding that I don't have as much control as I think I do.

 

My files are named with the following nomenclature: NOTE.(lastname).(firstname).(Type).(Date)

Note.Deer.John.Type.2021-10-28

 

My goal is to count the number of occurrences of a period " . " to make sure that the Flow that produced this file:

1. Named it correctly (I don't have any control over that between Flow sending the file to OneDrive and it hitting someone's Outlook inbox...)

2. There are an appropriate number of pieces to take out of the string so that PAD won't blow itself up with an error. (Assuming someone's fingers have been all over the file name... or the origination of the file failed to correctly name the file.)

 

I've resigned myself to simply taking the string apart piecemeal for each iteration to isolate what data I need, again, piecemeal. If the string contains different aspects each time it'll be impossible to design one flow to iterate every possible combination of strings. I don't want to manually review all these files one at a time to make sure they're made of the right components. Instead I want to be able to pick out the ones are "complete" and disregard the ones that aren't.

 

Desired result:

Note.John Deer.Type.2021-11-19 (Would be ignored)

Note.Jane.Doe.Type.2021-10-27 (Would get picked up and iterated)

 

Any idea how to make this happen in PAD?

1 ACCEPTED SOLUTION

Accepted Solutions
Highboy
Super User
Super User

You could use "Parse text" 
%Positions.count% would tell you how many . you have in your filename

Highboy_0-1637374604624.png

 

View solution in original post

3 REPLIES 3
Highboy
Super User
Super User

You could use "Parse text" 
%Positions.count% would tell you how many . you have in your filename

Highboy_0-1637374604624.png

 

Dope! I'll give it a try. Thanks for the aid, Highboy!

Works like a charm!

 

I've got my flow working for me now rather than against me! Thanks again, Highboy!!!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Top Solution Authors
Top Kudoed Authors
Users online (4,570)