Save rules to a text file