1.11M Members

how to remove junk character

 
0
 

Hi Team,

I am new to shell script.
Do kindly help me remove junk character from a file having a million records.. As it is production setup do kindly advice

Thanks ...
Whizkidash

 
0
 

Do kindly explain exactly what you need. Junk character means nothing.

 
0
 

hi

Junk character like ^M,#,$

 
0
 

That "^M" is a unix line end, use the dos2unix command first. For the rest use sed.

 
0
 

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

This really works

 
0
 

i have used this command but how to use it when we do not know how many time it will be repeated????

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article