hofer,
I suggest that you open an example called "Write to Text File.vi" and modify it to do what you are after. You can find the example by choosing Help >> Find Examples, then browsing to Fundamentals >> File Input and Output.
I did a quick modification and am attaching a screenshot; that way (and since I don't know what LabVIEW version you use), you can compare the shipping example with my modification, see how I solved it, and learn by doing the modifications yourself.
Regards,
John