There is list of file path from which I have to extract country name.
Example:
File Path |
G:\A\AS\Projects\Input\Guam & NMI\Apple.xlsx |
G:\A\AS\Projects\Input\Form\Guam & NMI\Apple_1.xlsx |
G:\A\AS\Projects\Input\Indonesia\Mango.xlsx |
G:\A\Projects\Input\Singapore\Mango.xlsx |
G:\A\Projects\Input\Output\Singapore\Mango.xlsx |
Now the logic should be is to select the data which is between Last \ symbol and second last \ symbol because the number of \ symbol could vary but the country name will always before the last \ symbol
Output:
File Path | Country |
G:\A\AS\Projects\Input\Guam & NMI\Apple.xlsx | Guam & NMI |
G:\A\AS\Projects\Input\Form\Guam & NMI\Apple_1.xlsx | Guam & NMI |
G:\A\AS\Projects\Input\Indonesia\Mango.xlsx | Indonesia |
G:\A\Projects\Input\Singapore\Mango.xlsx | Singapore |
G:\A\Projects\Input\Output\Singapore\Mango.xlsx | Singapore |
Hey @Sshasnk, as long as that pattern is consistent as you say there'll be a few variations that work for this. If you use the RegEx tool in Parse mode with the following expression then this will work:
.+\\(.+)\\
User | Count |
---|---|
17 | |
14 | |
10 | |
6 | |
6 |