want to grep only strings in a file?

Hai,

Just want to print only alphanumeric in a file

ex:-

fdsdsklf\#@^%$\#hf

output:- fdsdsklfhf

plz, help me:o

tr -dc '[:alnum:]' < inputfilename > outputfilename

Thnx ya!:slight_smile:

echo fdsdsklf#@^%$#hf | sed 's/[^a-zA-Z]//g'

To get alphanumeric using sed command..

$ echo fdsdsklf#@^%$#hf0124 |sed 's/[^a-zA-Z0-9]//g'

try this also..

If the file is Huge size
Try this...........

sed 's/[^a-zA-Z0-9]//g' inputfilename > outputfilename