in reply to tagging question

If you just want this on the command line to read from one file and write to STDOUT (great for seeing that it works):

perl -pe '/^(\w{2})(.*)/;$_ = "<$1>$1$2<$1>\n"' data.txt

Cheers,
Ovid

New address of my CGI Course.