Add newline_values_only and flaten output methods.

Fixs #9443.
Merge pull request #14705 from NicholasTD07/add_newline_values_only

Add newline_values_only and flaten output methods.