Text file Write with format and write boolean value to a text file