Get a file name without []

Dears,

I’m facing a challenge for getting file name as a string not a list:

-I’m having many documents starting with same name
(com_tat_${domain}_herewillberandomword.pdf)

-I have 2 recorder variable, ${domain} as string & doc1 as List with default value []

-I’m processing an excel sheet to get ${domain}

-Get Folder content, list as file, filter Name (regexp): as com_tat_${domain}.* and saved result to doc1

-Now when I enter keystroke from variable doc1, I’m getting the below
[C:\documents\com_tat_somedomainname_somerandomword.pdf]

What I need to achieve is to get the file name as C:\documents\com_tat_somedomainname_somerandomword.pdf

Could you please help me ?

Regards,
Isehaq

Hi @ialwahaibi
You simply need to remove the brackets? How about using the replace text action. Like in the example I sent in another thread:
image

2 Likes

@ialwahaibi you need to use for each loop to get the string value rather than the list. The list is always written in square brackets even if you don’t have it in the text.
Use this:
-For Each ${element} in ${doc1}
-Enter keystrokes from ${element}

It should print the file name without brackets

2 Likes

Hi @timriewe,

Thank you, it solves the issue with more steps.

@ashapkina,

Thank you for prompt support,

It works,

1 Like