Writing entity value to a file

Hello,

I would like to write the value of some entities into a file (in www directory) to fetch it via http. The notification file works like that but is producing a continously growing logfile and also a header.

Is there a way just to write the entities into a file in just one line and overwrite it everytime?

Many thanks!
Stefan