global-streetscapes / create_folders.sh
matiasqr's picture
deleting initial images
23869ba
raw
history blame
No virus
578 Bytes
#!/bin/bash
# Define the input CSV file
INPUT_FILE="svi_count_by_city_updated.csv"
# Check if the input file exists
if [[ ! -f "$INPUT_FILE" ]]; then
echo "File $INPUT_FILE does not exist."
exit 1
fi
# Read the second column from the CSV file and create directories
while IFS=, read -r _ second_col _ _ _ _ seventh_col _; do
if [[ "$second_col" != "" && "$seventh_col" != "" && "$second_col" != "header_name" && "$seventh_col" != "header_name" ]]; then
folder_name="${seventh_col}-${second_col}"
mkdir -p "$folder_name"
fi
done < <(tail -n +2 "$INPUT_FILE")