#!/bin/bash
#set -x

output="tranco_V99PN_gTLDs_resolved_final_nocdn_geolocation.csv"
rm $output
# Check if the filename is provided as an argument
if [ "$#" -ne 1 ]; then
    echo "Usage: $0 filename"
    exit 1
fi

# Read the filename from the first argument
filename="$1"

# Check if the file exists
if [ ! -f "$filename" ]; then
    echo "File not found: $filename"
    exit 1
fi

# Read each line of the file
while IFS=',' read -r param1 param2 param3
do
    # Process each pair of parameters (param1 and param2)
    param3_=$(echo "$param3" | tr -d '\r')
    # Add your processing logic here
    ./one_geo.py $param1 $param2 $param3_ >> "$output"
done < "$filename"

