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