This the my script i am editing postscript files and want to search entities and replace with exact special character.

eg:

s/\α/a/g; s/\β/ß/g; s/\&zeta1;/\\xce\\xb6/g;
Pls help me in this.
system("dir *.ps /b >file.log"); open(in, "file.log"); @files = <in>; close(in); system("del file.log"); foreach $files(@files) { open(inp, $files); $file = "New" . $files; open(out, ">$file"); while(<inp>) { while(/\[\/FitR ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)\]/) { s/\[\/FitR ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)\]/\[\/FitH $2\]/; } s/3B2 Total Publishing System 7\.51d\/W/3B2 Publishing System/g; s/\&alpha;/a/g; s/\&beta;/ß/g; s/\&chi;/chi/g; s/\&delta;/delta/g; s/\&epsi;/epsi/g; s/\&beta;/beta/g; s/\&phi;/phi/g; s/\&gamma;/gamma/g; s/\&eta;/eta/g; s/\&iota;/iota/g; s/\&thetav;/thetav/g; s/\&kappa;/kappa/g; s/\&lambda;/lambda/g; s/\&mu;/mu/g; s/\&nu;/nu/g; s/\&omicr;/omicr/g; s/\&pi;/pi/g; s/\&theta;/theta/g; s/\&rho;/rho/g; s/\&sigma;/sigma/g; s/\&tau;/tau/g; s/\&upsi;/upsi/g; s/\&sigmav;/sigmav/g; s/\&omega;/omega/g; s/\&xi;/xi/g; s/\&psi;/psi/g; s/\&zeta1;/\\xce\\xb6/g; s/\&Delta;/Delta/g; s/\&Phi;/Phi/g; s/\&Gamma;/Gamma/g; s/\&Lambda;/Lambda/g; s/\&Pi;/Pi/g; s/\&Theta;/Theta/g; s/\&Sigma;/Sigma/g; s/\&Upsi;/Upsi/g; s/\&Omega;/Omega/g; s/\&Xi;/Xi/g; s/\&Psi;/Psi/g; s/\&prime;/'/g; s/\&plus;/+/g; s/\&sol;/\//g; s/\&z.urule;/\//g; s/\&ff;/ff/g; s/\[\/Dest \/bib.[0-9][0-9][0-9][0-9] \/Title \(fig\) \/OUT pdfmark//g +; if((/\/OUT pdfmark/) && (/\/Title \((fig|bib|tbl|sec)\)/)) { s/\[\/Dest \/.*? \//\[\/Dest \/unknown \//; } print out $_; } close(inp); close(out); $file =~ s/\n//; $files =~ s/\n//; system("ren $file $files"); }

In reply to Re^2: unicode pls help by leelavenu
in thread unicode pls help by leelavenu

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.