Copy the exact text to the indicated blank space

Hi,
I am working with an application where I need to automatically copy and paste the opened file name into the mentioned blank space. Attached in the image below. Is there any way for it? using use application -Type into

attached below the screen shot. File Name should be copied to the lookup table wbs.

@vignesh.maruthappan

  1. Use get attribute and get the title by indicating the whole window which would give you the filename
  2. Then use type into on the required field

After get attribute based on what value you need …you might need to do some string manipulations.check the same

Cheers

1 Like

thanks and let me try it out

1 Like

i tried but i do get a error.in the area of type into-type this i need to type the variable name?\

image

@vignesh.maruthappan

What you gave looks correct…may I know what is the error?

cheers

image
is it because of special characters. Can we define or assign like i required certain name from it.

can we write a conditiion for it
image

@vignesh.maruthappan

try to split with - and .

str.Split("-"c)(1).Split("."c).First

cheers

1 Like

Hi @vignesh.maruthappan

If it always starts with ex & end with PSW

System.Text.RegularExpressions.Regex.Match(TestText, "ex.*?PSW").Value

Hope this helps :slight_smile:

thanks a lot. Starts with ex and always do not end with psw. may be i can try out with substring value if possible

great. Let me try it.thanks

@vignesh.maruthappan

Use the expression mentioned by @Anil_G directly in Type Into with some edit,

OPA.Split("-"c)(1).Split("."c).First

regards,
Ajay Mishra

1 Like

@Anil_G @Ajay_Mishra i do get this error.any solution or idea on it?

image

@vignesh.maruthappan Screenshot of Typeinto activity?

hi @vignesh.maruthappan

I guess you need to remove the Special Characters such as _ .
Can you try with

yourStringVariable.Replace(“_”," ")

This might help.

image

Hi @adiijaiin can’t get you. Can help to eloborate.sorry

@vignesh.maruthappan

try using hardware events in the properties…that should solve

or if you dont need any special characters then you can remove all of them…let us know

cheers

@vignesh.maruthappan rewrite quotes once again or just copy below mentioned query


OPA.Split("-"c).First().Split("."c).First.ToString

Regards,
Ajay Mishra

Is the field in which you takes special characters? if it doesn’t takes it. You would have to replace the special characters such as _ (underscores) using this expression:

yourStringVariable.Replace(“_”," ")

or By using this :

System.Text.RegularExpressions.Regex.Replace(variable, “[^a-z A-Z 0-9]”, “”)