Hi, I have a flow that gets data from a csv file in sharepoint. To simplify it the file data looks like this normally:
25,1,i,5/19/2020,"5,522","5,455"
My flow is able to get each record and create a record in the entity successfully when it is formatted this way.
However, sometimes if the last two fields are less then 1,000 it is formatted without the quotations like this:
25,2,i,5/19/2020,777,888
I was able to put some logic and conditions in and am able to get each record and create a record in the entity for this format as well. But I am having a hard time getting it to work for this format where only one of them is in quotation (or with 4 digits):
25,2,i,5/19/2020,"4,444",888 or 25,2,i,5/19/2020,444,"8,888"
I tried to set an string variable and set the value of it to capture the last quote (using "8,888" as reference) using the last() expression: last(split(items('Apply_to_each_CSV_row'),',')[6]). But it doesn't seem to see the quote. Then I tried to set it to a integer variable and set the value to see if the length of the last field is greater then 3. But it gives me an error that the variable of type int, can't be assign a value of string. I tried using the int(string) expression but that didn't work.
Here are my inputs and outputs from the csv and into flow:

here's a snip of my flow: This part checks to see if both fields have quotes. The left side (yes) works, its the right side that i need help with. Condition 3 checks to see if the left field is in quotes, or the right field is in quotes. Here I am using the 2nd to last row as a manual case and setting laststring = 5, but that did not work as well. Its like it does not see the 5.

Hoping someone can help. Thanks.