in reply to path changing problem

I think you want something like this:
perl -wi.bak -pe 's!/171/!/mmt/171/!' /path/to/dir/*

Delete .bak files when you have confirmed that it did what you wanted.