LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-20-2001, 02:30 PM   #1
Philipp
LQ Newbie
 
Registered: Sep 2001
Location: Madison, WI USA
Distribution: RedHat
Posts: 2

Rep: Reputation: 0
Question replace null characters in a file


I have a bunch of files containing null characters that I need to remove. Does anybody have an idea how to do that? Seems to me that most search utilities can only search for non-null text?

Thanks,
Philipp
 
Old 09-20-2001, 02:46 PM   #2
d3funct
Member
 
Registered: Jun 2001
Location: Centralia, WA
Posts: 274

Rep: Reputation: 31
Have you looked at the "gsub" argument in awk? something like this:

gsub(/\000/,"") # all nulls in each line
$0=$0 # resets fields if necessary
.... processing code goes here .....
 
Old 09-20-2001, 03:29 PM   #3
Philipp
LQ Newbie
 
Registered: Sep 2001
Location: Madison, WI USA
Distribution: RedHat
Posts: 2

Original Poster
Rep: Reputation: 0
That does it. Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Check to see if a file has Null Data farmerjoe Programming 3 03-15-2005 03:43 PM
What applicability of a file /dev/null ukrainet Linux - Newbie 1 12-01-2004 10:04 AM
Switch stdout between /dev/null and a file? gremlin2000 Linux - General 2 06-08-2004 08:12 AM
Switch stdout between /dev/null and a file? gremlin2000 Linux - Newbie 1 06-01-2004 11:13 AM
Help! Null Characters to spaces FoxyNewbie Programming 7 05-27-2004 01:10 PM


All times are GMT -5. The time now is 04:37 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