Saturday, 8 June 2013

Edit all lines at once

Edit all lines at once

I have a .txt file with almost all the airports of the world. Each line is a different airport, and the lines are in this format: City, Country - Airport Name (Airport Code)
ie:
Le Mans, France - Arnage (LME)
Detroit, USA - Willow Run (YIP)
San Francisco, USA - San Francisco International (SFO)
(the complete .txt is here: http://snipt.org/AnT8)
But I want in this format: "City, Country - Airport Name (Airport code)" => "Airport Code"
(yes, with quotes, it's for PHP codding)
ie:
"Le Mans, France - Arnage (LME)" => "LME"
"Detroit, USA - Willow Run (YIP)" => "YIP"
"San Francisco, USA - San Francisco International (SFO)" => "SFO"
How can I do this at once?
Thank you.