Entering edit mode
6.1 years ago
Vasu
▴
770
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