Read and replace file