122145-252521-000, 245684-52354841-454
for x in newlist:
key, val = x.split('-',1)
h[key].append(val)
122145 ['252521-000']
245684 ['52354841-454']
122145 252521-000
245684 52354841-454
newlist = ['650776-2200520-000', '654446-0444530-000', '788126-8895872-000']
new_list = [' '.join(x.split('-',1)) for x in newlist]
print(new_list)
In [8]:
['650776 2200520-000', '654446 0444530-000', '788126 8895872-000']
new_text = '\n'.join(' '.join(x.split('-',1)) for x in newlist)
print(new_text)
In [9]:
650776 2200520-000
654446 0444530-000
788126 8895872-000