In SQL heißt der Befehl Translate und man braucht nix programmieren:

update datei
set field = translate(field, ' ', x'00')