code to dump comma separated values or input stream