convert-sym2num.pl 475 Bytes
Newer Older
priyank's avatar
priyank committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#!/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;
}