Leggi tutto il file in una stringa, scrivi la nuova stringa e riscrivi il file che hai appena letto.