I have some data files and I wish to rename them for my pipeline.
The files look like this:
{unique_ids}_{experiment_condition}_L{3_digit_number}.txt I need to rename them so the experiment condition flag will appear at the end of the filename, before the extension as follows:
{unique_ids}_L{3_digit_number}_{experiment_condition}.txt Length of unique_ids and experiment_condition is not fixed.
Example:
ghad312fd2_Mb_L002.txt becomes ghad312fd2_L002_Mb.txt.
Thank You!
unique_idsorexperiment_conditioncontain underscores?renamecommand? What is the output offile $(readlink -f $(which rename))?{unique_ids}_L{3_digit_number}_{experiment_condition}.txt, but your example file name (ghad312fd2_Mb_L002.txt) is{unique_ids}_{experiment_condition}_L{3_digit_number}.txt. Can you give us a clearer example?