perl -ple 'goto LINE if /bala/; s/([^:]+)([^:]+)/$2$1/' file.txt file.txt