Re: Duplicate words | uniq\sort?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Frank,

I just created a quick test file and sort -u didn't quite work for me (technically it should do what you are asking) but then I realised that I had invisible spaces after some of the words and so they were not deemed uniquely different by the system. Perhaps you are having the same issue. However, I found that the following seems to work - I think it pushes the "spacebar" space into a new line creating unique words minus the space formatting:

cat words.txt | tr " " "\n" | sort -u

Regards,
Tahir


On Sun, Feb 16, 2014 at 4:17 PM, Robert P. J. Day <rpjday@xxxxxxxxxxxxxx> wrote:
On Sun, 16 Feb 2014, Frank Murphy wrote:

> I have 554 words in the following file one word per line.
> Some words are repeated up to 3 times.
>
> words.list
>
> If I try "cat words.list | uniq -u"
> It dumps all repeated words, I need one copy of all words.
>
> uniq words.list > uniq.list
> Words are still duplicated.
>
> sort words.list | uniq
> leaves about 20 words total
> which I feel is wrong as
> cat words.list | uniq -c
> shows about 100 non-dupe words
>
> Haven't much success with sort either.

  sort -u?

rday

--

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux