Hi
Input:
1)FW 88.5 Default OFS to update 4.xlsx
Yesterday by Lalitha
2)FW 50.3 Default OFS to update.xlsx
Today by Suresh
3)FW 6.5 Default OFS to update 37.xlsx
3 days ago by Sriram
from above sample input need only filename.
Output:
FW 6.5 Default OFS to update 37.xlsx
Above is the output
Thanks
Likitha
Anil_G
(Anil Gorthi)
December 8, 2022, 5:47am
3
Hi @vinjam_likitha
Please try this
System.Text.RegularExpressions.Regex.Matches(str,"(?<=\d\)).*")
This should be given in assign
Output type is matchcollection(create a variable of this type and use the variable on left side of assign)
Use a for loop with in as matchcollection variable and type argument(you will find in properties panel of for loop) as match and inside the for loop you will get the result as currentitem.value
This will give all 3 file names
Cheers
Hi,
Those input i get from datatable using “for each row in data table” i will read each file we need to use regular expression for each input file
Thanks
Likitha
Can you try this inside for each row,
getFileName = System.Text.RegularExpressions.Regex.Match(str1,“(?<=\d)).*”).ToString
Thank!
Gokul001
(Gokul Balaji)
December 8, 2022, 6:17am
6
Hi @vinjam_likitha
Inside the For each row in Data Table activity use if activity
System.Text.RegularExpressions.Regex.Match(Currentrow("ColumnName").Tostring.Trim,"(?<=\d\)).*").Tostring.Contains("FW 6.5 Default OFS to update 37.xlsx")
In then You can processed with the flow.
Regards
Gokul
@Anil_G for each file as input do i need to use same regular expression?
when i used it i am getting output:
System.Text.RegularExpressions.MatchCollection
Gokul001
(Gokul Balaji)
December 8, 2022, 6:21am
8
You can try with System.Text.RegularExpressions.Regex.Match
in the expression @vinjam_likitha
Anil_G
(Anil Gorthi)
December 8, 2022, 6:24am
9
Hi @vinjam_likitha
This is how you use it.Check the xaml. You need to loop to get all results
BlankProcess5 - Copy (6).zip (3.6 KB)
If you are doing it in datatble for each then
use this directly in your for each data row
System.Text.RegularExpressions.Regex.Match(Currentrow("Column Name").Tostring.Trim,"(?<=\d\)).*").Tostring
I hope your datatable contains 1) ,2) and 3) in the values
cheers
raja_ias
(PALANIRAJA PARAMAN)
December 8, 2022, 6:28am
10
if u r getting ur input one by one, you can use var.split(".'c)(0)
Gokul001:
“(?<=\d)).*”)
if i use this then output is balnk
i am not using “for each” for regex
thanks
1 Like
Anil_G
(Anil Gorthi)
December 8, 2022, 6:40am
13
Hi @vinjam_likitha
That is the reason I gave the second part as well
System.Text.RegularExpressions.Regex.Match(Currentrow("Column Name").Tostring.Trim,"(?<=\d\)).*").Tostring
Can you confirm if you will have 1) ,2) and 3) as well in the excel data?
If not can you exactly give how the data would be
cheers
system
(system)
Closed
December 11, 2022, 6:40am
14
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.