#!/usr/bin/perl -w while (<>) { if (/'5'/) { s/[Nn]01/N01(+5) /g; s/'5'/'5';fac=5/g; s/^/NET1TOP BOX (NET);\n/g } etc… print "$_"; }