How to move the folders to a new directory based on their match in the csv file?
Hi,
Don't know whether I can ask this question here or not. Need some help.
There are folders like "F1", "F2", "F3","F4", "F5" in the current directory "SD". In the current directory there is a csv file mentioning the folder names like below.
csv file:
id
F1
F4
F3
I want to move the folders to a new directory based on their matching in the csv file.
Lets say new directory is "POT". For eg:
We see that folder names F1, F4, F3 are matching with the csv file. So, I want to move those folders into POT directory.
I tried this way but it didn't work:
xargs -a <(tail -n +2 file.csv) -I{} sh -c '[ -d "{}" ] && mv -t POT "{}"'
Any help is appreciated. Thank you
• 698 views
•
link
0 answers
No answers yet.
Log in to answer this question.
Hello Bioinfo!
We believe that this post does not fit the main topic of this site.
Not strictly bioinformatics, try Stack Overflow
For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.
If you disagree please tell us why in a reply below, we'll be happy to talk about it.
Cheers!