Remove all JUNK character from file.

Hi Team,

I have a file having size greater than 1 GB. What i want to do is to check if it contains any JUNK character (ie any special charater thats not on the key board stroke). This file has 532 column & seperated with ^~^.

I have found some solution from the file, but it is for a specific junk character not for all.

Can someone help me...

check if this helps:

grep -v '[A-Za-z0-9]' filename

Hi Yogesh,

No it is not working. In my file i have found one of the special character "�". But ur command is not showing it.

He means:

grep '[^[:print:]]' filename

I typically use this:

sed -e 's/[^ -~]//g' file_in > file_out

This removes all junk characters. not all lines with junk --- just all junk characters.

To tell if a file has junk . .. .

grep -c '[^ -~]' file_in