How could I rename multiple files like,
IonXpress_049.T11014.R_2014_11_13_11_26_35_user_PR2-41-Pooling0026_3140_13112014.bam
IonXpress_050.T11114.R_2014_11_13_11_26_35_user_PR2-41-Pooling0026_3140_13112014.bam
To,
T11014.bam
T11114.bam
awkcommand linerenamesed
How could I rename multiple files like,
IonXpress_049.T11014.R_2014_11_13_11_26_35_user_PR2-41-Pooling0026_3140_13112014.bam
IonXpress_050.T11114.R_2014_11_13_11_26_35_user_PR2-41-Pooling0026_3140_13112014.bam
To,
T11014.bam
T11114.bam
Best Answer
There are several ways to rename from command line. Here is a one liner. Go to the directory where the
.bam
files are located and try this,How it works:
.
usingawk
as,One can use custom field separator using
-F
option. Seeman awk
for more.