$ perl -pi.bak -e'substr($_,index $_,q/"/) =~ s/\s+//g if /^\s+Tag\s*{/ .. /^\s+}/ and /^\s+Name\b/' file.txt