1

NUL characters in the text file, If I copy these characters to notepad they show just spaces, but my validate bat script which reads this and does some validation is halting at these NUL characters

its a feed file containing some junk characters, how to removed them with teh bat script.

I have tried with the below, its not happening

setLocal EnableDelayedExpansion > "%OutputFile%"
for /f "usebackq tokens=* delims=|" %%a in ("%InputFile%") do (
set s=%%a
>> "%OutputFile%" echo.!s:~24!
)

I am not having good knowledge on writing bat scripts, but need to fix this. appreciate your help.

Sharan
  • 253
  • 4
  • 14
  • 1
    `find /V "" < "%InputFile%" > "%OutputFile%"` replaces NUL characters by spaces... – aschipfl May 05 '17 at 11:35
  • 1
    Are you sure that the text file you want to process from command line is not UTF-16 Little Endian encoded? See for example [this answer](http://stackoverflow.com/a/43052862/3074564) in case of not knowing anything about text encoding. – Mofi May 05 '17 at 12:45

0 Answers0