Solved

Removing all special characters from an file

Posted on 2002-05-30
6
268 Views
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?
0
Comment
Question by:kennybud416
  • 3
  • 3
6 Comments
 
LVL 84

Expert Comment

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

Author Comment

by:kennybud416
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)?
0
 
LVL 84

Accepted Solution

by:
ozo earned 50 total points
ID: 7046256
tr(\x80-\xff)(letters of your choice to be a replacement)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:kennybud416
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.
0
 
LVL 84

Expert Comment

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

Author Comment

by:kennybud416
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

867 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now