perl -ne "print((<>)[0..3])if/ou/" test.txt