-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·34 lines (27 loc) · 880 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
cd ML
echo "NAME,DEPMAX,DEPMIN,DISTANCE" > depmin.csv
if ls *.wa 1> /dev/null 2>&1; then
echo "Processing .wa files..."
for file in *.wa; do
echo "Processing file: $file"
output=$(gsac << EOF
rh $file
lh dist depmin depmax
q
EOF
)
depmax=$(echo "$output" | awk '/DEPMAX/ {print $NF}')
depmin=$(echo "$output" | awk '/DEPMIN/ {print $NF}')
dist=$(echo "$output" | awk '/DIST/ {print $NF}')
if [ -n "$depmax" ] && [ -n "$depmin" ] && [ -n "$dist" ]; then
echo "${file},${depmax},${depmin},${dist}" >> depmin.csv
echo "Data written to CSV for $file: $depmax, $depmin, $dist"
else
echo "Data not found for $file"
fi
done
else
echo "No .wa files found in the directory."
fi
echo "CSV file creation complete."