chemodiversity/simulations/average_everything.fish

13 lines
325 B
Fish
Raw Permalink Normal View History

2018-06-25 21:20:51 +00:00
#!/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