are these every 5th lines different in any way ? is it possible to filter by using grep ? that would make it easy
grep 'some.filter' file.txt|awk ....
cat file.txt | while read line ; do
if [ "$int" == "5" ]; then
echo "found line nr 5"