944,155 Members | Top Members by Rank

Ad:
Nov 4th, 2009
0

how to remove junk character

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
whizkidash is offline Offline
20 posts
since Nov 2009
Nov 4th, 2009
0
Re: how to remove junk character
Do kindly explain exactly what you need. Junk character means nothing.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Nov 4th, 2009
0
Re: how to remove junk character
hi

Junk character like ^M,#,$
Reputation Points: 10
Solved Threads: 0
Newbie Poster
whizkidash is offline Offline
20 posts
since Nov 2009
Nov 4th, 2009
0
Re: how to remove junk character
That "^M" is a unix line end, use the dos2unix command first. For the rest use sed.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Sep 16th, 2010
0
Re: how to remove junk character
sed -e 's/[^ -~]//g' file_in > file_out

This really works
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sulekhaantil is offline Offline
1 posts
since Sep 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Shell Scripting Forum Timeline: What's wrong with the if condition
Next Thread in Shell Scripting Forum Timeline: Display the number of Readable, Writable and executable files





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC