LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Blogs > NullTerminator
User Name
Password

Notices

Old

sed awk tr etc

Posted 01-15-2013 at 06:33 AM by NullTerminator
Updated 01-18-2013 at 06:54 AM by NullTerminator (add sed cmd for non prinitng char)

A couple sample to strip unreadable characters from a binary file
Code:
# Translate junk characters into newlines while squeezing
C:\Temp>tr -sc '[\011\012\015\040-\176]' \n < blob_of_data.txt

# Translate and discard single character lines
C:\Temp>tr -sc '[\011\012\015\040-\176]' \n < blob_of_data.txt | awk "length($0) > 1"
# replace a bad character in a file
0xa0 is a 'non breaking space' that appears often when...
LQ Newbie
Posted in Uncategorized
Views 635 Comments 0 NullTerminator is offline

  



All times are GMT -5. The time now is 04:09 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration