Only create an output file when data is available.