Find the answer to your Linux question:
Results 1 to 7 of 7
Hi There, I have recently put together a file [ dictionary ] for use with John. It has took me some time to gather different types of dictionaries, languages excetra. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2003
    Location
    Glasgow. Scotland
    Posts
    9

    Alphabetically list a file ?


    Hi There,

    I have recently put together a file [ dictionary ] for use with John. It has took me some time to gather different types of dictionaries, languages excetra. I am now left with a 80 MB file listed with each dictionary a-z consecutivley. Knowing Linux I am sure there must be a way to edit the file [ maybe with vi ? ] as so to list the file as one concurrent dictionary... Also does anyone know of any places I could pick more dictionaries ?

    All help or suggestions are accepted thankfully.


    Thanks again.

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    try this (back up the files first!)

    Code:
    cat <file1> >> <bigdictfile>
    That would add the contents of <file1> to the end of <bigdictfile>

    repeat for all the dictionary files, and you will have 1 big file with all the words in.

    Jason

  3. #3
    Just Joined!
    Join Date
    Oct 2003
    Location
    Glasgow. Scotland
    Posts
    9

    <bigdictionary>

    Thanks Jason, but that sounds like about two hours work to me [ I should have thought of that when i was compiling the file in the first place ] i have been looking at a command I found "sort" ? would this not sort the file into alphabetical order ????

  4. #4
    Linux User
    Join Date
    Jun 2003
    Location
    Calgary, AB CANADA
    Posts
    496
    I think he's already got them all in one big file with individual chunks of alphabetically listed entries. He now wants to have all the entries sorted alphebetically.

    Try this:
    Code:
    sort dictionary > dictionary-new
    or you could have originally done:
    Code:
     cat file1 file2 file3 | sort > dictionary

    *edit: You beat me in, lub0. Yep, try the sort command.
    \"Everything should be made as simple as possible, but not simpler.\"
    Albert Einstein

  5. #5
    Just Joined!
    Join Date
    Oct 2003
    Location
    Glasgow. Scotland
    Posts
    9

    Shear Luck

    Thanks CopperTop, believe me I accidently stumbled across that command, by the looks of it you already new it .


    [quote] sort dictionary > dictionary-new

    It worked a treat, cheers mate.

  6. #6
    Just Joined!
    Join Date
    Oct 2003
    Location
    Glasgow. Scotland
    Posts
    9

    strange characters

    Hi all,

    CopperTop this is mainly aimed at yourself, after running the command

    sort dictionary > dictionary-new

    I find I now have strange characters at the end of some of the words Example:


    asoon^M
    aspaththiriyila
    aspaththiriyila^M
    assiden^M


    Strange, any ideas

    Many advance thanks for your help.

  7. #7
    Linux Engineer Giro's Avatar
    Join Date
    Jul 2003
    Location
    England
    Posts
    1,219
    This is where you have been using files in DOS format on linux, They are carrage returns at the end of each line, You can try this -> http://www.xys.org/~science/forum/messages/21695.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •