As we can see ^@ is Null character in this file
I want to remove only the first few null characters before string 00000305
How can we do that, any idea. I want a new file without first few null characters before string 00000305.
Output file format required : 00000305^@^@^@^@^@^@430^@430^@^@^@^@^@^@^@^@^@09079989530
Please do not use words like "Urgent", it is not encouraged to use these kind of words in forums. Could you please let me know what has NOT worked? Because as per your shown output it worked, please be clear in your questions/asks, show more sample Input_file with code tags and show sample expected output(with all conditions) in code tags too.
By definition, UNIX text utility tools work on text files, and text fiies do not contain NUL bytes. Some text utilities on some operating systems can handle NUL bytes even though doing so is not required by the standards. But, of course, you haven't bothered to tell us what operating system you're using.
Are there always three NUL bytes that you want to remove? Or, does the number of NUL bytes vary? If the number varies, you can use something like od to determine the number of leading NUL bytes and then you can use dd to skip over those bytes and copy the rest of the data in the file to another file.