remove tabs, support appends and overwrites