Rename with date

date
from this i need only 18jul2019 that to in this format without whitespace others to be removed of how can achieve this.Which string function can i use to do

@soumi_soumiya
Parse the string as a DateTime object and then use the ToString function to return it in the format that you want.
DateTime.Parse(dateString).ToString("ddMMMyyyy") where dateString is the value shown in your Message Box.

1 Like

System.DateTime.Now.ToString(“ddMMMyyyy”) - this will return the current time (19JUL2019) according to your computer.

1 Like

I dont want the system date i need the date when the mail has been received so i got the time date and day information from the mail and stored in a variable now i should take only the date and use it for renaming the file how can i achieve it

where should i give this

@soumi_soumiya
Use this in assign activity…
StrValue.Split({" “},StringSplitOptions.None)(1)+StrValue.Split({” “},StringSplitOptions.None)(2)+StrValue.Split({” "},StringSplitOptions.None)(3)

1 Like

@soumi_soumiya
You can use a Move File activity to rename the file. Just “move” it from the old filename to the new one. So let’s say your file is on the desktop and is called mail.msg you can do Move File with Path set to
"C:\Users\your_username\Desktop\mail.msg" and Destination set to "C:\Users\your_username\" + DateTime.Parse(dateString).ToString("ddMMMyyyy") + ".msg"

Thanks a Loot it works
mail%20id
can you help me how can i remove the space between soumi and soumiya and how to remove double quotes i had removedsoumiyas14@gmail.com using Split(name.ToString(),“<”)(0) but i am not able to remove the space

StrValue.Split({" “},StringSplitOptions.None)(1)+StrValue.Split({” “},StringSplitOptions.None)(2)+StrValue.Split({” "},StringSplitOptions.None)(3)
by using this i have completed it

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.