Removing special characters in file

I have file special.txt with the following data.
<header info>
123$ty5%98&0asd
1@356fgbv78
09*&^5jkns43(
...........some more rows.

In my output file, I want to eliminate all the special characters in my file and I want all other data. need some help.

If you are looking for removal for special and junk characters, you can use

strings filename

otherwise, if you want to remove some specified special characters

you can do

sed 's/[!@#\$%^&*()]//g' filename

include what ever special characters you want to remove in the square braces of above sed.

Mahendra,

your second solution is fine, but the first solution isn't working.

Regards,
Raju

Came in handy for me...Thanks!!

$ cat file1
123$ty5%98&0asd
1@356fgbv78
09*&^5jkns43(

$ sed "s/[^a-z|0-9]//g;" file1 > file2
$
$ cat file2
123ty5980asd
1356fgbv78
095jkns43

$

# awk '{gsub(/[[:punct:]]/,"")}1' file

i tested your awk command it is for real, hey any site for awk command?
at least i will have a referrence someday :slight_smile: