perl -npi.bak -e 's:(\w\d+\.data):testname/$1:g' file1.txt