There are many ways to do this.
First of all, is the form on the same machine as the user and is it ever intended to be accessed remotely (from the internet?).
If it is on the same computer, a simple program should suffice.
If it is to be accessed from different locations via the Internet, it will reside on the web server. Therefore an HTML form should be used. But, as was said, HTML can never modify a contents of a file (no client-side tech will). You would have to use a server-side application through CGI.
From here, it all depends on what you have to work with. Does your web server support CGI? If so, does it support any of Perl, ASP, PHP or C server side apps? Tell us.