rewrite the formated contents to the input file