Update log_to_csv.sh

added wildcard support + functions