Add support for using format for flatfile