Replace all 'low values" in a file

Hi,

I've to replace all low values (hex '00') in a flat file (containing more than 1,000,000 records) with space (hex '20').
I try to use:

awk '{gsub("\x00","\x20")}' file_name

and I obtain the following response:

awk: Line AP000010536900577986 cannot have more than 199 fields.
The input line number is 1. The file is file_name.
The source line number is 1.

Can anyone help me?

Thanks in advance.

Stefano

It looks like your input file is all one "line", and there's a hard limit in awk for the number of fields (space separated since that's the default behavior without '-F' being used with awk).

I imagine that sed, being stream oriented, won't have this issue, so I'd try

sed -e 's/\x00/\x20/g'  input

and see what you get.

Thanks a lot! Your command works well!

In the meanwhile I'd transformed my flat file in a text file (with cr+lf), where one record is 1500 chars long.

In this instance I'd like to use the awk command, but I obtain the same results (note that your suggestion works even in this case...). It's only to understand where I made an error.

Thanks a lot.

Stefano