next up previous contents index
Next: adding fields with formatting Up: Examples Previous: command option file   Contents   Index


sorting and combining values in different ways

When converting from a sus file to another format, by default all entries are extracted in the order given. If one wishes to sort the entries according to the value of a certain expression, multiple entries with the same value must be combined somehow. By default, the average of the numeric values is taken (string values are simply concatenated).

Command: table2sus < graph.out | sus2text --sort 'float(vertices)'

graph.out

#vertices	edges	run1  run2   

10		20	123.6   141.3
20		80	2321.4  842.9
10		40	432.8   832.0
20		40	943.1   314.2

output

vertices edges run1    run2  

10.0     30.0  278.2   486.65
20.0     60.0  1632.25 578.55

One can combine multiple entries using the minimum, maximum, mean, sum, or product of the values using the --combine option. Here we take the minimum.

Command:
table2sus < graph.out | sus2text --sort 'float(edges)'
--combine min

output

vertices edges run1   run2 

10       20    123.6  141.3
10.0     40.0  432.8  314.2
20       80    2321.4 842.9

One can also sort the entries according to some expression. Here we sort the records based on the total time for both runs.

Command:
table2sus < graph.out | sus2text
'--sort=float(run1)+float(run2)'

output

vertices edges run1   run2 

10       20    123.6  141.3
20       40    943.1  314.2
10       40    432.8  832.0
20       80    2321.4 842.9


next up previous contents index
Next: adding fields with formatting Up: Examples Previous: command option file   Contents   Index
Tobias Polzin 2003-05-30