Thanks again! Could you just explain a detail to me please?
My file ended up with too many lines, so I added this command:
awk -v n=13 'NR>n{print a[NR%n]}{a[NR%n]=$0}'
to removes the last 13 lines, it works, but I would rather use
awk -v n=NR/2 'NR>n{print a[NR%n]}{a[NR%n]=$0}'
to remove...