Skip to content

Instantly share code, notes, and snippets.

@scajanus
Created October 29, 2014 14:04
Show Gist options
  • Select an option

  • Save scajanus/85b3fcdf2e2b6675e945 to your computer and use it in GitHub Desktop.

Select an option

Save scajanus/85b3fcdf2e2b6675e945 to your computer and use it in GitHub Desktop.
#!/bin/bash
{ list=( [0-9]*.csv ); head -n 1 "${list[1]}" & tail -q -n +2 "${list[@]}"; } > merged.csv
num=$(echo $(head -n 1 merged.csv | wc -c) - $(head -n 1 merged.csv | tr -d ';' | wc -c) | bc)
echo ${num}
mkdir plots
for i in $(seq 2 $num)
do
name=$(eval "head -n 1 merged.csv | cut -d\";\" -f $i")
echo $name
gnuplot << EOF
set terminal png
set output "plots/$name.png"
set datafile separator ';'
set timefmt "%d.%m.%Y %H:%M:%S"
set xdata time
plot 'merged.csv' u 1:$i w l title columnhead
EOF
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment