Reputation: 137
Is there any short cut to quick edit this with vim beside recording action, then apply to all lines?
From:
French Polynesia French Polynesian
Gambia The Gambian
Georgia Georgian
Ghana Ghanaian
Grenada Grenadian
Guam Guamanian
To:
French Polynesia French Polynesian
Gambia The Gambian
Georgia Georgian
Ghana Ghanaian
Grenada Grenadian
Guam Guamanian
Upvotes: 0
Views: 117
Reputation: 3053
If you can replace the spaces with hyphens like below (from your example, it's hard to give a method for this initial step that I'd be sure would work with other variations that you might have in your data):
French-Polynesia French-Polynesian
Gambia The-Gambian
Georgia Georgian
Ghana Ghanaian
Grenada Grenadian
Guam Guamanian
Then you can run %!column -t
to get this:
French-Polynesia French-Polynesian
Gambia The-Gambian
Georgia Georgian
Ghana Ghanaian
Grenada Grenadian
Guam Guamanian
Then do %s/-/ /g
to get to this:
French Polynesia French Polynesian
Gambia The Gambian
Georgia Georgian
Ghana Ghanaian
Grenada Grenadian
Guam Guamanian
Upvotes: 1