![]()
i want to extract only file name “My Portfolio_20190809_NL01000229_EP.xlsx” from the message in save notification bar as shown in figure.
Can some one help me in split operation sample to handle this case
![]()
i want to extract only file name “My Portfolio_20190809_NL01000229_EP.xlsx” from the message in save notification bar as shown in figure.
Can some one help me in split operation sample to handle this case
Hi @KavithaManohar
Strinvar=Strvar.replace(“.xlsx”,“”)
You can get only the my portfolio_20190809_NL01000229_EP
Thanks
Ashwin.S
kindly post the full string that you are getting…
Hi @KavithaManohar,
you can try, YourString.split((“save “,” (”),StringSplitOption.None). This will give you only the filename as output.
Check the video in the below link for your reference.
Best of luck,
Sid
Try this StrVar1=StrVar.Split("."c)(0)
You will get the excepted answer.
Thanks,
Mohanraj.S
If the above split method is worked for you then Please mark my reply as solution in order to close the thread.
Thanks,
Mohanraj.S
can you please post the error…
Hi @KavithaManohar,
I didn’t understand your real situation. But I have exampled with string and array.
String variable
strResult = strVariable.Split(New String() {“(”}, StringSplitOptions.None)(0)
Array Variable
ArrResult = strVariable.Split(New String() {“(”}, StringSplitOptions.None)
Regards
Balamurugan.S
Fine
hope these steps could help you resolve this
–so first to get that text either we can get from a assign activity like this
out_filename = Directory.GetFiles(“yourfolderpath”,“*.xlsx”).OrderbyDescending(Funtion(d) New FileInfo(d).CreationTime).ToList(0)
where out_filename is a string variable
or
we can get that with a simple get text activity where we click on the popup and get the text we want and save it to a string variable
–i hope the first option is best and in that you are now ready with output
because it will give the file name we want
or
–if by get text with output variable in_text and split by means
out_filename = Split(in_text.Split(“save”)(1).ToString.Trim,“(”)(0).ToString.Trim
this will give the file name as well
hope this would help you
kindly try this and let know for any queries or clarification
Cheers @KavithaManohar
Tried both the ways but facing compiler issue:(
When you apply the first Split function, it returns an array, and you take the first member of that array
out_Report2.Split(“save”)(1)
Which I guess is already a string. So, is a ToString with a Trim really required?
Also, you’re taking the output from the first Split, and splitting it again with “(”
Question becomes, are you getting a Char as an output that is causing the compiler to fail on the third ToString conversion?
Just try the above solution i mentioned with out stringsplitoption value. Just attaching the example i tried for your reference.

Thanks,
sidtest.xaml (4.6 KB)
Can u provide me a sample .xaml file please so that my output will be “My portfolio_20190809_NL010010229_EP.xlsx” when my i/p string is ““Do you want to open or save My portfolio_20190809_NL010010229_EP.xlsx (126 KB) from bpr.aa.net?””