Delete buffer before writing append from line 1