This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to process file as per https://www.youtube.com/watch?v=gF-f25dRbo8 | |
# Outputs to test.txt by default. | |
# Inputs as files on command line | |
import fileinput | |
if __name__ == "__main__": | |
output = 'test.txt' | |
with open(output, 'w') as f: | |
f.writelines(list(name + "&" + key.replace('+',' ') + "\n" for name, *keys in (line.strip().split('\t') for line in fileinput.input()) for key in keys)) |