Is there any command to stop the loop?

Hello everyone
I wan’t to play a loop that reads the records from a CSV and does some stuff with it. Is there any command I can use with if/else to stop the loop in a certain situation? Thanks.

What situation? In any case you can break a loop by