Name

It may be convenient to track the statistics from more than one file or data column in parallel. The name option causes the default prefix "STATS" to be replaced by a user-specified string. For example, the mean value of column 2 data from two different files could be compared by
    stats "file1.dat" using 2 name "A"
    stats "file2.dat" using 2 name "B"
    if (A_mean < B_mean) {...}

Instead of providing a string constant as the name, the keyword columnheader or function columnheader(N) can be used to generate the name from whatever string is found in that column in the first row of the data file:

    do for [COL=5:8] { stats 'datafile' using COL name columnheader }