import json BARCODE_DATA_FILE = r"C:\programdata\trancon\boxwisepro\blobs\BW Order\exports\Barcode 2022-04-21 100007136.json" barcodes = {} with open(BARCODE_DATA_FILE, "r") as f: for line in f: jsonDataForLine = json.loads(line) barcode = jsonDataForLine["Code"] if barcode not in barcodes: barcodes[barcode] = 0 barcodes[barcode] += 1 for barcode in filter(lambda x: barcodes[x] > 1, barcodes): print "Duplicate barcode \"{}\" occurs {} times".format(barcode, barcodes[barcode])