Avatar of James Froggatt
James Froggatt
Flag for France asked on

Trimming out just the town/city names from a list using regular expressions

I have a long list of towns/cities, here's a sample:

1      Tórshavn      STR      13,335
2      Klaksvík      NOR      4,842
3      Hoyvík      STR      4,124
4      Argir      STR      2,188
5      Fuglafjørður      EYS      1,541
6      Vágur      SUD      1,342
7      Vestmanna      STR      1,236
8      Miðvágur      VAG      1,120
9      Sørvágur      VAG      1,108
10      Saltangará      EYS      1,012

I wish to efficiently create a list of just the towns/cities in Notepad++ so it looks as follows;

Tórshavn
Klaksvík
Hoyvík
Argir
Fuglafjørður
Vágur
Vestmanna
Miðvágur
Sørvágur
Saltangará

In Notepad++ what regular expression can I use to do this in the Replace "Find it" box.

Thank you
regexp.jpg
Regular Expressions

Avatar of undefined
Last Comment
James Froggatt

8/22/2022 - Mon
Dimitris Maleas

In notepad++ you can delete the columns very easy with the following procedure
Press and hold the SHIFT + ALT keys, and move down using the DOWN arrow on the keyboard (while still holding SHIFT + ALT).
James Froggatt

ASKER
I can use that to remove the number and space up to the first character of the town name, but then there's no clear column to use after that to delete after the town/name i.e.


Wien      Wien      1,897,491
Graz      Stm      288,806
Linz      OÖ      205,726
Salzburg       Sbg      154,211
Innsbruck      Tir      132,110
Klagenfurt      Ktn      100,817
Villach      Ktn      62,243
Wels      OÖ      61,727
Sankt Pölten      NÖ      55,044

So I think I need a regular expression now, to the effect of;

"On each line select everything after the first space after the first word "

Thanks
ASKER CERTIFIED SOLUTION
Dimitris Maleas

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
James Froggatt

ASKER
Thank you all, this helped me sort this data out.
Your help has saved me hundreds of hours of internet surfing.
fblack61