“C:\Users\abk\OneDrive - Amss\Documents\test file\5743939.csv” how to get 5743949 from this above file path
Try with this expression
Path.GetFileNameWithoutExtension("C:\Users\abk\OneDrive - Amss\Documents\test file\5743939.csv")
Regards
Gokul
2 Likes
Rgex for this (\d+)\.csv
System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“(\d+)\.csv”)
1 Like
Use the regex expression to extract the output. Please find the below regex expression.
System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“(\d+(?=.csv))”)
Hope it helps!!
1 Like
1 Like
I think so you’re trying to get the FileName so it would be a better option to use.
fileName= Path.GetFileNameWithoutExtension(PathVariable)
This would be returning, you the filename irrespective of whether its number or characters.
1 Like