How can I rename a file by contains string in url ( not full string url )?

Hi , guys . I have another problem

Ex : This is my dynamic url :
sp-web.search.auone.jp/search?client=mobile-kddi&channel=android&sr=0000&q=*
sp-web.search.auone.jp/search?client=mobile-kddi&channel=android&sr=0000&q=&tr=

It’s different between “tr” and “not tr” . Some time my url was generated include tr , some time it was not . So, How can I rename a file by contains string in url ( not full string url ) ?

HI @Anh_Nguyen

Can you elaborate your query and give us some input and expected output?

Regards
Gokul

1 Like

Firstly , Thanks for taking time . I have file with dynamic name which generated from my url .
But My dynamic file some time include “tr” at last , some time it’s not
example : abc_edf/q=‘1234’/tr=‘123’.png
abc_edf/q=‘1234’.png

I can rename file dynamic with ‘abc_edf/q=*’. But when file add more ‘/tr=…’ . I can’t rename . so , How can I do it ?

Hi @Anh_Nguyen,

I’m not sure if I understand your question, do you mean you want to rename only files with &tr in the filename?

Using abc_edf&q=* will target all files that start with abc_edf&q=, you don’t need to add the &tr, but you could, if you wanted to only target files that included *&tr= in the name, in that case it would be abc_edf&q=*&tr=* or even *&tr=*. If you simply wanted to remove the &tr part, you could split on &tr, then assign the first part of the resulting array to the file name + .png.

Does that answer your question?

Kind Regards

Hi @Anh_Nguyen,

If i understood your question correctly, your file name creation is dynamic, but whenever URL is having “/tr”, activity used to rename is not working properly.
If yes, then while doing the renaming you can verify whether the url is having “/tr” or not and replace it with “” and rename the file else directly rename the file.

If this is not what you asking, kindly elaborate more on problem statement

Thanks,
Shahabuddin N