I have file names as SMP_ACC_STG_20210987654.txt and another filename SMP_ACC_STG_BS_20210987654.txt. I can use @substring(item().name,0,11) and i get SMP_ACC_STG for first file which is correct but for second file I need to get filename as SMP_ACC_STG_BS and it returns same file name as first because i have harcoded the length in substring. I tried using indexof but it didnt give me the expected result.
I need to extract the text before _20210987654.txt and use that as filename.
I have used the below, and got my file names:
Which gave me: