#!/bin/bash

# Source and destination directories
src="dev_outputs/simgcd"
dst="dev_outputs/simgcd_txtonly"

# Find and copy all .txt files, preserving the directory structure
find "$src" -type f -name "*.txt" -exec bash -c 'mkdir -p "$1/$(dirname "${2#$3/}")" && cp "$2" "$1/${2#$3/}"' _ "$dst" "{}" "$src" \;

