info_UV.sh 709 Bytes
Newer Older
1 2
#!/bin/bash

Vincent De Bussy's avatar
Vincent De Bussy committed
3
grep -e  "^\s[A-Z][A-Z][0-9][0-9]" -r  data/*.edt > donnees.txt
4 5
cut -d ':' -f 2-6 donnees.txt > donnees2.txt
cut -c 2- donnees2.txt > donnees3.txt
6

7 8
cut -c 1-4 donnees3.txt >donnees4.txt
uniq -c donnees4.txt > donnees5.txt
9

10
sort donnees5.txt | cut -c 8- > donnees6.txt
11

12
uniq  donnees6.txt > donnees7.txt
13

14
nb_uv=$(wc -l donnees7.txt | awk '{print $1}')
15

Vincent De Bussy's avatar
Vincent De Bussy committed
16 17

rm uv_nb_etu.txt
18 19 20
touch uv_nb_etu.txt
for i in `seq 1 $nb_uv` ; do
    uv_id=$(cat donnees7.txt | head -$i | tail -1)
Vincent De Bussy's avatar
Vincent De Bussy committed
21
    uv_nb_etu=$(grep $uv_id data/*.edt -m 1 | wc -l)
22 23 24
    echo $uv_id $uv_nb_etu >> uv_nb_etu.txt
done
uniq uv_nb_etu.txt
25

26
rm donnees?.txt
Vincent De Bussy's avatar
Vincent De Bussy committed
27
rm donnees.txt
28

29
#grep "SY02" data/api_init_projet_EdT/EdT/Data/*.edt -m 1 | wc -l
30 31 32 33 34 35