Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Joaquin Alzola Newsgroups: comp.lang.python Subject: RE: Howw to prevent the duplication of any value in a column within a CSV file (python) Date: Tue, 26 Apr 2016 16:07:19 +0000 Lines: 24 Message-ID: References: <75e5d8dc-e15b-4350-95e8-490abd4aa14f@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Trace: news.uni-berlin.de PuQ5LqmcSMu3bXH88tpqcQUeAGre/qHajq1ftcX+dn7A== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'column': 0.07; 'subject:file': 0.07; 'csv': 0.09; 'subject:CSV': 0.09; 'python.': 0.11; 'subject:python': 0.14; 'message-----': 0.15; 'subject: \n ': 0.15; 'value.': 0.15; '(python)': 0.16; '2016': 0.16; 'advance!': 0.16; 'privilege.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'skip:[ 60': 0.16; 'pfxlen:0': 0.18; 'prevent': 0.20; 'to:name:python-list@python.org': 0.20; 'to:2**1': 0.21; 'import': 0.24; 'header:In-Reply-To:1': 0.24; 'wondering': 0.25; 'entered': 0.27; 'have,': 0.27; 'function': 0.28; 'values': 0.28; 'dictionary': 0.29; 'url:mailman': 0.30; 'code': 0.30; 'url:python': 0.33; 'skip:- 10': 0.34; 'url:listinfo': 0.34; 'file': 0.34; 'sent:': 0.35; 'subject:': 0.35; 'but': 0.36; 'url:org': 0.36; 'created': 0.36; 'email addr:python.org': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:10': 0.37; 'thanks': 0.37; 'charset:us-ascii': 0.37; 'names': 0.38; 'does': 0.39; 'subject:the': 0.39; 'from:': 0.39; 'url:mail': 0.40; 'to:addr:python.org': 0.40; 'email addr:gmail.com': 0.62; 'within': 0.64; 'contact': 0.66; 'python- list': 0.66; 'email name:python-list': 0.67; 'subject': 0.70; 'disclose': 0.71; 'duplication': 0.84; 'subject:any': 0.84; 'subject:value': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lebara.onmicrosoft.com; s=selector1-lebara-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ExIi7ajDaZf8sIijO6DmYx9CshiH4jBU8jSTT/VlQyo=; b=f+Iu2gwzvhMlQ2S3ErVklO4QBhISD0zOsnJqZQUkXHN3u/3unH+kLY/cshg1sb72G0u6zBLbHlXFLAqoSYgOkr7XWiyRktDujb/E90t1+t6OcuOh91PYRPUUbkG7mx/FAu/AXJtFQEifR6Dt9I9HCJPY+6fcSB2TchbsjdEyB5Y= Thread-Topic: Howw to prevent the duplication of any value in a column within a CSV file (python) Thread-Index: AQHRn9VtgXv+FqSVMUycropIKX1MNZ+ca2xw In-Reply-To: <75e5d8dc-e15b-4350-95e8-490abd4aa14f@googlegroups.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=lebara.com; x-originating-ip: [165.225.80.110] x-ms-office365-filtering-correlation-id: 6d876438-65f9-4218-df0f-08d36decd842 x-microsoft-exchange-diagnostics: 1; HE1PR07MB1354; 5:/dzc0D5PUTidn4ptM7Hi1Z8gedsdFHoFpHNEFpk+HBcDVHTPigld+8BWaUPLtNJ1QnAGJ++opzHo+4WmXPvNVi1Kmf0fK9xJsBYToLI12HgrKMjnPxCv17Ag5Wlpu1JnqKuzq9oOxEweQVKLSkqe8g==; 24:shvCuSZOkFBSare+jfLBJR/m+IRHY9KBx/dEffFOAE/1C48x2vTA1NqY3s+JXFpwGi5HRHK9PyxdKP92lUzRmaDar+RKnxoHpLsPRF7sMNw=; 7:8hBAgJ03PbXwVnw9cxxL9+qtx8d/OYuC3YnavpV7MCbPC6Kx4qCrWxIcEXlaj+fHzfwSdPyVDNpJoAeJip3e+8b8nux7TaXLIWnZvAsdA3JBLIt00izT1sLK+yC50GLKpZ9ZW+EK9/Xo8ZYFbYVDcC+mRHne5B1VTrLjbC5fbHm9ZCwc0l/+QzPb3Z5NAzTr x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR07MB1354; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(9101521072)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001); SRVR:HE1PR07MB1354; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB1354; x-forefront-prvs: 0924C6A0D5 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(51874003)(9686002)(6116002)(3846002)(189998001)(102836003)(33656002)(1096002)(1220700001)(50986999)(2906002)(76176999)(54356999)(5002640100001)(5003600100002)(81166005)(5001770100001)(76576001)(586003)(92566002)(106116001)(3280700002)(5004730100002)(5008740100001)(3660700001)(107886002)(122556002)(77096005)(19580395003)(19580405001)(2501003)(66066001)(2950100001)(2900100001)(86362001)(10400500002)(87936001)(74316001)(15975445007); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB1354; H:HE1PR07MB1356.eurprd07.prod.outlook.com; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM X-OriginatorOrg: lebara.com X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2016 16:07:19.6873 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d7093539-83cd-4991-b1b3-aacef74cf097 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB1354 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <75e5d8dc-e15b-4350-95e8-490abd4aa14f@googlegroups.com> Xref: csiph.com comp.lang.python:107696 import csv Use dictionary {key:value} -----Original Message----- From: Python-list [mailto:python-list-bounces+joaquin.alzola=3Dlebara.com@p= ython.org] On Behalf Of peakgraphicz@gmail.com Sent: 26 April 2016 17:01 To: python-list@python.org Subject: Howw to prevent the duplication of any value in a column within a = CSV file (python) I am wondering how to make my code function so it does not allow any of the= same values to be entered into a column in my CSV file created through pyt= hon. So I need to read into the CSV file and check if any names have alread= y been entered. If they have, the user must not be allowed to enter this va= lue. Thanks in advance! -- https://mail.python.org/mailman/listinfo/python-list This email is confidential and may be subject to privilege. If you are not = the intended recipient, please do not copy or disclose its content but cont= act the sender immediately upon receipt.