Skip to content

Instantly share code, notes, and snippets.

@kafkaesqu3
Created December 4, 2017 20:31
Show Gist options
  • Select an option

  • Save kafkaesqu3/f2c9774b07981ddd7b43d194660022af to your computer and use it in GitHub Desktop.

Select an option

Save kafkaesqu3/f2c9774b07981ddd7b43d194660022af to your computer and use it in GitHub Desktop.
Expands csv file from format key1,var1,var2 into key1,var1 \n key1,var2
file = open('title-cve.txt', 'r')
output = open('title-cve-out.txt', 'w')
for line in file:
tmp = line.split('|')
title = tmp[0]
cvelist = tmp[1].split(',')
for cve in cvelist:
output.write(tmp[0] + '|' + cve + '\n')
file.close
output.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment