Fetching the excel file name

Input
2040001 to 2040021 stock schedule summary Sep 21
I want to fetch sep 21
How to fetch and how to get if the month characters changes in every excel file?

try this

@anjani_priya

Hi even though if the two formats it will pick exactly Sep-21 or Sep 21 and if the month and dates changes also it will exactly matches

try this

[A-Za-z]+(?:[\s\-])\d+$

hope it will help for you

@anjani_priya

Can you please explain the format?

1.[A-Za-z]+: This part of the pattern matches one or more alphabetical characters. It's represented by [A-Za-z]`,

2.The + sign following it means that one or more of these letters should be present.

3.(?:[\s\-]): it will match the white space or hyphen anything if prasent if hypen is present it will take

4.\d+: This part matches one or more digits. \d represents any digit from 0 to 9, and the + sign means that one or more digits should be present.
5. $: This anchors the regular expression to the end of the line matching it will be used.

1 Like

If the month is at middle of the excel file name means?
Cant I fetch file name and fetch month in it at a time?

you can try this syntax then, it will match any were in the path exactly the month name is in 3 letters or completely full month name it will match

[A-Za-z]{3,}(?:[\s\-])?\d+

@anjani_priya

not like this
I want a syntax for fetching the file name and also fetch the month name in it?

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