Read filename (number only)?

I want to read filename number only.

output round1 = 12
output round2 = 34

Please guide me about it.


First use For Each activity and use Directory.GetFileName(“FolderPath”)

Inside For Each place a Assign activity and write as below
fileName = path.GetFileNameWithoutExtenstion(item.ToString)

Once done Place a message box and write system.Text.RegularExpressions.Regex.Match(fileName,“\d+”).Value

To see the result

Check below for your reference

Hope this may help you


1 Like

Please check this Xaml file, hope it can help you

Main.xaml (11.6 KB)

1 Like

@fairymemay - Another Approach…

Directory.GetFiles("YourFolderPath").Select(function(x) system.text.regularexpressions.Regex.Match(new fileinfo(x).Name,"^\d+").Value)
1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.