Hi, with the last x86_32 version of sed (windows platform) the following pattern sed '\?^$?D' don’t remove blank line from file if the file is in DOS format. In the previous version 2.2 this command working. In attach the demo test files. *sed --version :* *sed (GNU sed) 4.4* *Packaged by Cygwin (4.4-1)* *Copyright (C) 2017 Free Software Foundation, Inc.* *License GPLv3+: GNU GPL version 3 or later >.* *This is free software: you are free to change and redistribute it.* *There is NO WARRANTY, to the extent permitted by law.* *Written by Jay Fenlason, Tom Lord, Ken Pizzini,* *and Paolo Bonzini.* *GNU sed home page: >.* *General help using GNU software: >.* *E-mail bug reports to: >.* -- Saluti Mauro Rigoni