Question: (Closed) How to move the folders to a new directory based on their match in the csv file?
0
gravatar for Vasu
13 months ago by
Vasu320
Vasu320 wrote:

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

linux command mac • 223 views
ADD COMMENTlink written 13 months ago by Vasu320

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!

ADD REPLYlink written 13 months ago by WouterDeCoster38k
Please log in to add an answer.
The thread is closed. No new answers may be added.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 878 users visited in the last hour