Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

how to replace one character by another with PCL

how to replace one character by another with PCL

how to replace one character by another with PCL

Is there any PCL command to replace one character by another?

I'm migrating tons of oracle ascii reports from esc/p to PCL. Thanks to the great stuff i found here, i didn't need to change any line of oracle code. I've done the job by changing the printer definition file.

The last remaining thing i need to do is to replace the "=" character by  the "_" to improve the look of the reports.

Thanks for any idea.


RE: how to replace one character by another with PCL

I don't know of a PCL command to arbitrarily change one character to another, but you could put your text file through a filter to make the change before printing.

If you are on UNIX, the 'tr' command would do nicely, otherwise a 10 line C-program would do it.

Jim Asman

RE: how to replace one character by another with PCL

If the change in character refers to underlining.
For example using the equal = for double underlining and
dash - for single underlining and you want to underline
the text, using the underline character _ may not give you
the results you want. Here are a couple of suggestrions.

If using a fixed font at 10,12,16.66 cpi you should be
able to use chr$(27);"(10U" then use the line-draw characters chr$(205) and chr$(196) to replace = and - respectively.

If you want the underline on instead you will need to
use the underline on/off statement before and after the text. and eliminate the = or - characters.

chr$(27);"&d0D";"This text is underlines";chr$(27);"&d@"

(use 0D for fixed underlining [leading trailing apaces underlined] or 1D for floating underline.)

RE: how to replace one character by another with PCL

Thanks for the useful tips.       

The tr command has done the job very well and easily.

Martin Cabrera
Colombia South America.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close