#!/bin/bash

# Ask user for directory path
# Do not pass the data directory, only subdirectories
read -p "Enter directory path: " directory

for file in $(find $directory -name 'data*.csv'); do 
    if [ -f "$file" ]; then
        tar -czf "${file}.tar.gz" "$file"
    fi
done
