Trying to remove non-printable charaters(junk values) from a UNIX file
问题 I am trying to remove non-printable character (for e.g. ^@ ) from records in my file. Since the volume to records is too big in the file using cat is not an option as the loop is taking too much time. I tried using sed -i 's/[^@a-zA-Z 0-9`~!@#$%^&*()_+\[\]\\{}|;'\'':",.\/<>?]//g' FILENAME but still the ^@ characters are not removed. Also I tried using awk '{ sub("[^a-zA-Z0-9\"!@#$%^&*|_\[](){}", ""); print } FILENAME > NEW FILE but it also did not help. Can anybody suggest some alternative