>>150
Perl ならこんな感じ

perl -e "$n=1; while(<>){ s/(?<=menu)\d+/$n++/e; print }" < in.txt > out.txt