Commit 74df2f46 authored by Marc-Antoine Drouin's avatar Marc-Antoine Drouin
Browse files

correct bug in SIRTA checking

parent 5940cad3
......@@ -165,7 +165,7 @@ if [[ $ERREUR != 0 ]]; then
fi
if [[ $fich_type != "SIRTA" && $fich_type != "MF" ]]; then
echo "Le type de fichier doit etre SIRTA, MF ou P7"
echo "Le type de fichier doit etre SIRTA, MF"
exit 1
fi
......@@ -262,6 +262,8 @@ for file_ in "${input_files[@]}"; do
prof_n_chars=$((n_gates * N_CHAR_GATES))
prof_n_chars_p1=$((prof_n_chars + 1))
consignerMsg "number of vertical gates: $n_gates"
case $fich_type in
"SIRTA")
awk --posix -v cl31_cor="$cl31_cor" -v prof_n_chars="$prof_n_chars" -v prof_n_chars_p1="$prof_n_chars_p1" '\
......@@ -274,7 +276,7 @@ for file_ in "${input_files[@]}"; do
l==4 {if (NF==10) {l++;bloc=bloc"\n"$0;next} else e=1}
l==5 {if (NF==10) {l++;bloc=bloc"\n"$0;next} else e=1}
l==6 {if (length($0) == prof_n_chars || length($0) == prof_n_chars_p1) {l++;bloc=bloc"\n"$0;next} else e=1}
l==7 {if ($0 ~ /^[\003][0-9a-z]{4}[\004].$/) {p=1;bloc=bloc"\n"$0} else e=1}
l==7 {if ($0 ~ /^[\003][0-9a-z]{4}[\004].?$/) {p=1;bloc=bloc"\n"$0} else e=1}
p==1 {printf bloc"\n" >> cl31_cor;l=1;p=0}
e==1 {err++;print NR;l=1}
END {if ($0 ~ "File") printf "\n%s\n",$0>>cl31_cor; if (err>0)print "err=",err}' "$file_"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment