Score:-2

Run a loop that adds a prefix to multiple files within a directory for several directories

ng flag

I have several files tied to each sample. For instance, I have directories called Sample_1, Sample_2, and Sample_3. Each directory has four files: file_1, file_2, and file_3. I would like each file in each directory to have the prefix corresponding to the sample name. In Sample_1 directory, I would like the files to have Sample_1_file_1, Sample_1_file_2, etc. I am not sure what the best way is to do this. I have a total of 46 samples and so being able to do this much more efficiently would be tremendous.

Thank you for your help!

Sterling

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.