Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Removing all special characters from an file

Posted on 2002-05-30
Medium Priority
Last Modified: 2010-03-05
I would like to remove all the special characters from a file and replace it with the closest character possible.

Is there a script that I could use to do this?
Question by:kennybud416
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 84

Expert Comment

ID: 7045404
what characters do you consider special?
and what characters do you consider closest?

Author Comment

ID: 7045618
Any characters that unix can not interpt.

I.e. Dec value 128 to 225
     Hex value 80 to FF
     (both of the above are the same range).

Would it be possible to have a script which would ask me to enter in a letter of my choice to be a replacement (for the special character)?
LVL 84

Accepted Solution

ozo earned 200 total points
ID: 7046256
tr(\x80-\xff)(letters of your choice to be a replacement)
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 7047608
Right, but I need a perl script that will work on win32 platforms.  When I transfer the files from windows to unix the special characters are lost.  Thus having no special characters in unix.
LVL 84

Expert Comment

ID: 7048400
tr will work on win32 platforms
How do you transfer the files from windows to unix to lose the special characters?

Author Comment

ID: 7048933
I ftp (ascii). But when I open them up in Solaris 2.6 they are replaced with either nothing or some other weird character.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question