I want to keep only those sub-directories that are present in the corresponding directory from CSV file. The file structure looks something like this:
100_folder/
├── folder_11
├── folder_25
├── folder_31
└── folder_41
210_folder/
├── folder_13
├── folder_23
├── folder_31
└── folder_42
Information in CSV:
Col6,Col26
100,folder_11
100,folder_13
100,folder_41
210,folder_31
210,folder_42
Based on the information from the columns, I want to remove the sub-directories that are not present in CSV file.
Here is how I read the file:
eCollection=( $(cut -d ',' -f6,26 file.csv ) )
echo "${eCollection[@]}"