write text lines to a file