$foo = entire string (say 100+ characters); if {$foo contains a comma within the 15th thru 25th character from the left then replace it with a "+"; #I can use any nonalpha character here }; replace all commas in $foo with "\t"; #replace all commas with tabs replace all "+" with commas; # replace all plus-signs with commas