FILES = system("ls -1 pressure-*.csv") LABEL = system("ls -1 pressure-*.csv | sed 's/pressure-\\(.*\\)\\..*/\\1/'") set logscale y plot for [i=1:words(FILES)] word(FILES,i) using 1:2 title word(LABEL,i) with lines