Skip to content

Instantly share code, notes, and snippets.

@terrycojones
Created January 9, 2015 00:06
Show Gist options
  • Save terrycojones/741d0d86c24ac9920095 to your computer and use it in GitHub Desktop.
Save terrycojones/741d0d86c24ac9920095 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
seen = {}
for lineNumber, line in enumerate(sys.stdin):
if lineNumber:
fields = line.split('|')
key = '|'.join(fields[:2] + fields[3:])
if key in seen:
if seen[key]:
print
print seen[key],
seen[key] = None
print line,
else:
seen[key] = line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment