You can use the MORE command to convert each \0x00 into \0x0D\0x0A
more yourFile.ext >yourFile.ext.new
move /y yourFile.ext.new yourFile.ext >nul
- Each file must have fewer than ~64k lines else the command will hang (inserts a prompt and waits for a keypress after 64k lines)
- Tabs will be converted into a string of spaces
A more robust alternative is to use JREPL.BAT - a regular expression text processing command line utility for Windows. It is pure script (JScript/batch) that runs natively on any Windows machine from XP onward - no 3rd party exe file required.
As long as no file is too large (approaching 1GB?), then you can use the /M option to read the entire file into memory and perform the search/replace operation on one big string:
jrepl \x00 "" /m /f yourFile.ext /o -
For large files you can process the file line by line, but the null bytes require specification of a character set for the input which forces the use of ADO. The standard JScript file input routines choke on lines containing null bytes. ADO solves that problem. It does not matter what character set is chosen as long as it is a single byte character set.
jrepl \x00 "" /f "yourFile.ext|windows-1252" /o -
Full documentation is built into JREPL.BAT and available via
jrepl /? or
jrepl /?? for paged help. A summary of all options is available via
jrepl /?options, and a description of all help options is gotten via
JREPL.BAT is a lot of code for just this one task. It wouldn't be hard to whip up a very small dedicated JScript or VBS script for this task. But once you have JREPL in your arsenal, you will likely find many uses - it is a powerful tool.