New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
How to sort list based on word count ?
for example i have word lists :
good vps
bad vps
good vps company
vps
dedi
q4 top vps provider
i want to sort it based on word count so the result is :
vps
dedi
bad vps
good vps
good vps company
q4 top vps provider
how to do that? already search but have not found an answer. Word lists around 8k lines. Please help. Thanks.
Comments
do you have access to a
shell
onlinux
orsomething similar
? take an unsorted list of lines of words inunsorted.txt
and enter this shizfxf@box:~$ awk '{print NF,$0}' unsorted.txt | sort -n | cut -d' ' -f2- | tee -a sorted.txt
and presto you have pretty lines in
sorted.txt
yes i have access to shell. Thanks it's works.
Shell thanks
you sneaky dragon i liked how you thought of it, thanks