add charmask in split
improve writer