[R] rename multiple files by file.rename or other functions

Ulrik Stervbo ulrik.stervbo at gmail.com
Thu Sep 28 11:42:42 CEST 2017


Hi John,

I don't know how to do this with R, but on Linux I'd use rename (or maybe
even by hand if it's a one time event). On Windows I believe there is a
tool called Bulk Rename.

HTH
Ulrik

On Thu, 28 Sep 2017 at 11:37 John <miaojpm at gmail.com> wrote:

> Hi,
>
>    I have 50 files whose names are
>
> XYZW01Genesis_ABC.mp3
> XYZW02Genesis_ABC.mp3
> .......
> XYZW50Genesis_ABC.mp3
>
>    As you can tell, the only difference across the files are 01, 02,
> 03,....50.
>
>    I would like to rename them to
> 01Gen01.mp3
> 01Gen02.mp3
> .......
> 01Gen50.mp3
>
>   If I store them in one folder and write an R code in that folder, how can
> it be done?
>
>    Thanks,
>
> John
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list