Example 1: write text to file