Thank you, this not only does what I need but also helps me understand syntax better. Just one more question, if you don't mind. I understand why newline should be at the end of the dn: line now (e.g. first line) but why empty line also can't be like that?