Skip to main content
Solved

Replace spaces in file name with dashes

  • November 29, 2023
  • 2 replies
  • 199 views

vxn43
Supporter
Forum|alt.badge.img+18

I have 200 files. Their names have spaces. I want to replace these spaces in each file name with a dash. What is the best way to do this. I know I start with the pathnames reader. But, what is the next transformer(s) I need to add?

Best answer by takashi

Hi @timh ,

Alternatively, you can use File Copy writer (File Operation: Move) to rename files within a folder.

Rename "path_unix" read by the PATH reader to "filecopy_source_dataset".

Set your desired destionation filename to "filecopy_dest_filename".

Set "." (dot) to the Subfolder parameter in the File Copy writer feature type.

Set "Move" to the File Operation parameter of the File Copyt writer.

 

View original
Did this help you find an answer to your question?

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

When I need to do this I use a SystemCaller and the dos rename command.


takashi
Influencer
  • Best Answer
  • November 29, 2023

Hi @timh ,

Alternatively, you can use File Copy writer (File Operation: Move) to rename files within a folder.

Rename "path_unix" read by the PATH reader to "filecopy_source_dataset".

Set your desired destionation filename to "filecopy_dest_filename".

Set "." (dot) to the Subfolder parameter in the File Copy writer feature type.

Set "Move" to the File Operation parameter of the File Copyt writer.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings