Dear Power Automate community,
do you know if there is a more elegant solution for working with large text files and looking up and trimming?
Problem
Let's jump to an example. In the File below I am interested in getting back a list of values 1, 7, 13, 1.95. And of course the text can have different Input name and count.
{
Very long comment
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim ven
iam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea com
modo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupi
datat non proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.
}
Inputs:
int myInput1,
int SwitchA(1), // comment with text and sometimes brackets
int SwitchB(7), // comment with text and sometimes brackets
int SwitchC(13), // comment with text and sometimes brackets
double N1(1.95); // comment with text and sometimes brackets
consts:
My solution:
First, cut the large text into only the area I need which sits between "conss:" and "Inputs:". I do this because sometimes the comment mentions a similar format and constants, of course, have a similar format.
After that, I am calling a Python script and using the Regular expression \((.*)\)[\,\;] which only selects values between brackets and things to get a little bit messy since I get back one string in Brackets. Unfortunately found no way to use regular expression directly for extraction, only super easy ones for trimming. After some cleanup I finally get a nice list of values I have to convert to numbers and we rollin. But the actions necessary are .... well look yourself:

If anyone has any suggestions on how to make it nicer or easier I am all open to learning new things. Thank you for reading this far and I hope you have a great day.
Jakub