Skip to content

Instantly share code, notes, and snippets.

@MSeifert04
Created July 11, 2017 13:47
Show Gist options
  • Save MSeifert04/5c35af67aea9bd64df0bbe79d6104301 to your computer and use it in GitHub Desktop.
Save MSeifert04/5c35af67aea9bd64df0bbe79d6104301 to your computer and use it in GitHub Desktop.
thing = """1 ID:K-95 list of data
0 ID:D-56 list of other data"""
idtag = "K-95"
for line in thing.split('\n'):
if line.startswith('1') and line.startswith(idtag, 5, 5+4):
print(line)
# prints
# 1 ID:K-95 list of data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment