3

i have a data file that looks like this:

#processors    timea     timeb
1              45        150
2              25         80
3              13.43      60.2
4              10         40
5              8          38
6              7          35
7              6.5        34.2
8              5          32

I need to plot the corresponding speedup curves, which is basically

plot 'datapoints.dat' u $1:((first_valc1/$2)),\
     'datapoints.dat' u $1:((first_valc2/$3))

the variables "first_valc1" and ""first_valc2" should be the first values of the column im plotting, that is 45 and 150 respectively.

How i can do this automatically without hardcoding the numbers?? The idea is to use the same script for many data files.

1 Answer 1

4

I answer myself,

first_valc1=system("awk 'FNR == 1 {print $2}' datapoints.dat")
first_valc2=system("awk 'FNR == 1 {print $3}' datapoints.dat")
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.