Instead of above..solution for the following will help me.
I have to eliminate all characters between ^ and a space in a file.
Following lines -
Test ^ H^@^@^@^@^@^@^B^VDM-BM-$|M-^_M-F^AM- File1
Test^H^@^@^@^@^@^F^A^X^@^SM-s^TM-3M-G^A File2
Should be printed as below
Test File1
Test File2
I used sed '/^/,/ /d' command, but it is not working.
This looks like a binary format file when viewed with vi. Control codes are displayed as ^X . See "man ascii" for a table of these codes. For example "^@" is a null character (Hex 00).
If the ^X characters disappear in the "strings" version, the file contains control codes rather than actual "^" characters.
Accurate processing of a binary format file with text file programs such as "vi" , "sed" and "awk" is unlikely to produce a useful conversion. Your will need a proper program. If you just want to see an overview of the contents then "strings" will suffice.