I have this large directory of 1000+ files from a machine learning dataset, but these files have different qualities (pictures of roses vs. daises to keep it simple). I have this CSV file with the filenames of each of these items in the dataset as well as their categorization (roses vs. daisies). How can I read this CSV file and tell my file manager to move all of the rose photos to one directory and all of the daisy photos to another directory? Would I need to use a Bash script, or is this something that's already built into Nautilus?
|
Here is a bash script that should do what you want:
Save this script in a file, perhaps do_moves.sh, edit it to set the correct values for fileNameIndex and categoryIndex, then run it as: ./do_moves.sh < data.csv where data.csv is your CSV file. Make sure that you do not have any files that have the same name as a category before you run this. |
|||
|
|
|
Alright, a friend and I managed to write a script in Python that solved this quite well.
This tended to work better because I had more categories to deal with...hopefully this will work for anyone with the same problem. |
|||
|
|