linenum

This tool will replace text pattern with the line number.