-
Notifications
You must be signed in to change notification settings - Fork 0
/
max
executable file
·59 lines (56 loc) · 660 Bytes
/
max
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#! /usr/bin/awk -f
BEGIN{
if (ARGC>2)
{
print "#WARING: Average over multiple files!!";
}
if (ARGV[1]=="")
{
print "#FILE: STDIN";
}
else
{
print "#FILE:",ARGV[1];
}
if (col=="")
{
col=1;
print "#Setting column to",col,"(use option \"-v col=X\" to change)";
}
else
{
print "#Using column",col;
}
warn=0;
c=0;
}
/^[@#]/{
next;
}
{
if (NF>=col)
{
c++;
if (max == "")
{
max=$col;
}
if (max < $col)
{
max=$col;
}
}
else
{
if (warn == 0)
{
print "# Not enough data in line",NR;
warn++;
}
}
}
END{
print "#Output type: max #values";
print max,c;
}
#fs md5sum 18f878f18b579e2a6a1423f615e4abec