chemodiversity/simulations/average_everything.fish

13 lines
325 B
Fish
Executable File

#!/usr/bin/env fish
for file in (find . -name "*.log");
set -l out (echo $file | sed 's/log$/avg/');
echo "processing $file to $out...";
echo -n "AVG," > $out;
for col in (seq 2 15);
tail -n 50 "$file" | cut -d, -f $col | jq -j -s add/length >> $out;
echo -n "," >> $out;
end;
echo "" >> $out;
end