adding counter option and fixing the parsing of csv using |