in reply to replace specical char ^@ to empty char
If the two-character string "^@" actually does appear in the file, rather than being a representation of a null, then you would need to escape each character in the pattern, and use a grouping to indicate that the pair of characters may repeat: s/(?:\^\@)+$//g