#!/usr/bin/perl binmode(STDIN, ":utf8"); binmode(STDOUT, ":utf8"); # , to __101__ and vice versa # / to __102__ and vice versa while ($line = <>) { utf8::decode($line); $line =~s /([\p{IsN}]),([\p{IsN}])/$1__101__$2/g; # convert , comma to number __101__ (inside number) $line =~s /([\p{IsN}])\/([\p{IsN}])/$1zslash$2/g; # convert , comma to number __101__ (inside number) $line =~s /\t\x{002F}\t/\tzslash\t/g; # convert \t/\t slash to number __102__ print $line; }