I am trying to take the key and values in input .txt and produce the out put as in output.txt,basically for every value which in-turn is a key and has a value is put in oneline and the lines where the values are present are removed.... I can write the python implementation,I need inputs on how to get started on this..
'''
INPUT(input.txt):-
#KEY VALUE
353311
344670
332807 353314
338169 334478
334478
353314 353311
OUTPUT(output.txt):-
KEY VALUE
344670
332807 353314 353311
338169 334478
'''
with open('input.txt', 'rb') as f:
mainlist = [line.strip() for line in f]
print mainlist