I am a new user of python. I have a list in .txt format (and .csv) like this
NEW YORK ....... from
31 Chatty, Seager Aarhaus
Atlas, Jones Abertham
Polly, Manning Antwerpen
Amazon, Brittle Belchental
LONDON ........ for
31 Park Dattemroed
Eleanor, Mallett Civeta Naples
3 Aurora Frigate Ljubljana
and I want to have
NEW YORK ....... from 31 Chatty, Seager Aarhaus
NEW YORK ....... from Atlas, Jones Abertham
NEW YORK ....... from Polly, Manning Antwerpen
NEW YORK ....... from Amazon, Brittle Belchental
LONDON ........ for 31 Park Dattemroed
LONDON ........ for Eleanor, Mallett Civeta Naples
LONDON ........ for 3 Aurora Frigate Ljubljana
I try to use regex, but I could not get the results.
I wonder whether there is a way to do this.