LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   replace null characters in a file (https://www.linuxquestions.org/questions/programming-9/replace-null-characters-in-a-file-6740/)

Philipp 09-20-2001 01:30 PM

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

d3funct 09-20-2001 01:46 PM

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 .....

Philipp 09-20-2001 02:29 PM

That does it. Thanks!


All times are GMT -5. The time now is 03:36 PM.