NULL in between, at begining or at end of line - convert to space

How to replace null with space?

I want to make each line with 80 characters. If any line contains only 5 characters and remaining is null, then i want to make it as 80 characrets where 5 is original characters and remaining 75 characters will be null..

NULL can come in between the line, at begining the line or at end of line.

I have tried using

 
 tr '\0' '\40' < inputfile >> outputfile

But it did not work... can somebody help me.

sed 's/||/| |/g;s/||/| |/g' inputfile > outputfile

Hi Sudha,

But how can i make the entire line 80 characters by replacing NULl wityh space?
It is someing like left padding, right padding

try:

awk '{printf ("%80-s\n",$0)}' file