supporting both tab-delimited and json inputs