sullivanne
(Sullivanne)
1
Hello, my robot is looping through files in a folder and I would like it to remove spaces from the file name, how can I do this?
Parvathy
(PS Parvathy)
2
Hi @sullivanne
Use the below syntax:
CurrentFile.Name.Replace(" ","")
Hope it helps!!
lrtetala
(Lakshman Reddy)
3
Hi @sullivanne
Path.GetFileNameWithoutExtension(CurrentFile.ToString).Replace(" ", "")
Regards,
sullivanne
(Sullivanne)
4
Thank You, but robot removed spaces in variable but not in folder.
lrtetala
(Lakshman Reddy)
5
You need to use rename file activity @sullivanne
Regards,
Parvathy
(PS Parvathy)
6
Use Rename File Activity @sullivanne
Regards
Botzilla
(Edwin)
7
Hi,
Maybe something like this.
Path.GetFullPath(YourFilePath).Replace(" ","")
lrtetala
(Lakshman Reddy)
8
@sullivanne
Path.GetFileNameWithoutExtension(CurrentFile.ToString).Replace(" ", "")
Regards,
sullivanne
(Sullivanne)
9
I have error: The source doesn’t exist 
lrtetala
(Lakshman Reddy)
10
@sullivanne
Can you show the screenshot of workflow
Regards,
lrtetala
(Lakshman Reddy)
12
@sullivanne
Can you please print the currentItem in immediate panel or message box activity
Regards,
ashokkarale
(Ashok Karale)
14
@sullivanne,
Use this in Rename File activity.
Path.GetDirectoryName(currentItem)+"\"+Path.GetFileNameWithoutExtension(currentItem).ToString.Replace(" ","")
This should remove the file name spaces.
Thanks,
Ashok 