File size: 578 Bytes
23869ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/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")