Use -lines option instead of -offset/-length. This fixes problems with files using dos newlines (<CR><LF>).