-
Notifications
You must be signed in to change notification settings - Fork 0
/
stats.awk
37 lines (33 loc) · 860 Bytes
/
stats.awk
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
#!/bin/awk -f
BEGIN {
fulltext=0;
ebook=0;
video=0;
abstracts=0;
image=0;
selectedarticles=0;
autres=0;
audio=0;
FS="\t";
OFS=FS;
IGNORECASE=1
}
{if ($14 ~ /ebook/) then ebook++
else if ($14 ~ /fulltext/) then fulltext++
else if ($14 ~ /video/) then video++
else if ($14 ~ /abstracts/) then abstracts++
else if ($14 ~ /audio/) then audio++
else if ($14 ~ /selected/) then selectedarticles++
else if ($14 ~ /image/) then image++
else autres++}
END {
print " Ebooks: " ebook;
print " Full text: " fulltext
print " Video: " video;
print " Abstracts: " abstracts;
print " Audio: " audio;
print " Selected articles: " selectedarticles;
print " Images: " image;
print " Autre: " autres-1;
print "\nNombre total d'items dans le fichier KBART: " ebook + fulltext + video + abstracts + audio + selectedarticles + image + autres - 1
}