How to rename files with a specific pattern in R?
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 8 years ago . There are some .fcs files in a data.000X format (where X = 1, 2, 3...) in a directory. I want to rename every n file to the following format: exp.fcs (where exp is a text from a vector) if the file to be renamed is an .fcs file. in other words : I want to rename files to exp.txt, where exp is a text and not a consecutive letter(s) i.e. F, cA, K, etc. For example, from: data