#!/usr/bin/env python import sys def get_string( cell ): start_index=0 if cell.startswith("\""): start_index=1 end_index=len(cell) if cell.endswith("\""): end_index=len(cell)-1 return cell[start_index:end_index] def get_double( cell ): stripped=get_string(cell) if stripped=='': return 0 return float(stripped) def get_int( cell ): stripped=get_string(cell) if stripped=='': return 0 return int(get_string(cell)) for line in sys.stdin: cells = line.split(",") product_id=get_int(cells[0]) product_name=get_string(cells[1]) sales_quantity=get_int(cells[2]) sales_price=get_double(cells[3]) line_amount=get_double(cells[4]) key=str(product_id)+"_"+str(product_name) value=str(sales_quantity)+","+str(sales_price)+","+str(line_amount) print(key+"\t"+value)Dosyayı İndir