if [ -z $1 ]; then
    echo "Please provide the batch index."
    echo "Example: "
    echo "    sh ./run_combine.sh 1"
    echo "    sh ./run_combine.sh 2"
    echo "    sh ./run_combine.sh 3"
    echo "    sh ./run_combine.sh 4"
    exit 1
else
    index=$1
    data_dir="data"/"gpt-4o-mini"

    pattern="output_0402_"$index"_篩選結果.xlsx - Sheet1_*"
    python batch.py \
        -t combine \
        -i "$data_dir" \
        -prp "$pattern" \
        -rp "data/staging/output_0402_"$index"_篩選結果.xlsx - Sheet1.csv" \
        -o "data/staging/output_0402_"$index"_篩選結果.xlsx - Sheet1.postprocessed.csv"

    echo "All tasks completed."
fi