I have a list of names and contact numbers that is in a txt file, however, the names aren't alphabetized and makes it difficult to navigate through, how do I alphabetize the list?
I'm running Lubuntu 16.04.
I have a list of names and contact numbers that is in a txt file, however, the names aren't alphabetized and makes it difficult to navigate through, how do I alphabetize the list?
I'm running Lubuntu 16.04.
Please show a typical line from your text file and tell us how you want to alphabetize it. (I would guess that you want to sort it by first name or family name, but I don't know where you have the names in your text files.)
+1
The more data OP shares, the easier it will be to answer correctly. Otherwise, one can recommend
man sort or other online resources such as
https://www.computerhope.com/unix/usort.htm or
https://www.ibm.com/developerworks/c...files9?lang=en or
https://en.wikipedia.org/wiki/Sort_(Unix)
The list is like this;
As you can see the list isn't in alphabetical order, I'd like to alphabetize the list.Code:Sarandon, Susan - XXX-XXX-XXX Cruise, Tom - XXX-XXX-XXX Bale, Christian - XXX-XXX-XXX Goldblum, Jeff - XXX-XXX-XXX
If you want to sort according to family name, it is very easy. Assume that the list is in a file with the name unsorted-list.txt,
and the sorted (alphabetized) result is in the file sorted-list.txt.Code:sort unsorted-list.txt > sorted-list.txt
Thank you, that worked!
gedit will alphabetize a list for you too.
"Everybody is ignorant, only on different subjects." Will Rogers
As will LibreOffice Calc and Geany.
... LibreOffice Writer and Pluma too....
By the way, you need to activate the sort plugin in preferences in both gedit and pluma before sort appears in their menus. Or at least I had to in Ubuntu 16.04.
Ubuntu 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags
Member: Not Canonical Team
If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.
Bookmarks