GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
input := InputTextFile( "test.txt" ); LogTo( "log.txt" ); while ReadLine( input ) = "---\n" do Read( "examples.g" ); od;