1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Placing items in ABC order in Text file?

Discussion in 'The Lounge - Off Topic' started by mikehende, Jul 5, 2006.

  1. mikehende

    mikehende Kilobyte Poster

    265
    0
    19
    I exported the contents of my Media Library in my music software to a text file which has approx 600 entries, is there any way I can have them rearranged in Alphabetical order?
     
  2. Bluerinse
    Honorary Member

    Bluerinse Exabyte Poster

    8,871
    167
    256
    Copy and paste them into a spreadsheet like Excel and sort the entries in there.
     
    Certifications: C&G Electronics - MCSA (W2K) MCSE (W2K)
  3. mikehende

    mikehende Kilobyte Poster

    265
    0
    19
    Thanks, will give it a try.
     
  4. Jakamoko
    Honorary Member

    Jakamoko On the move again ...

    9,915
    60
    229
    Same idea, but I would right-click the .txt file and "open with" Excel. Seems easier, but maybe just me :)
     
    Certifications: MCP, A+, Network+
    WIP: Clarity
  5. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    Too bad you're running Windows. This is so easy to do in *nix it isn't funny. "sort -d filename.txt > tmp.txt; mv tmp.txt filename.txt".

    "sort -d filename.txt > tmp.txt" sorts your file alphabetically and outputs the sorted file to a file named tmp.txt. The "mv tmp.txt filename.txt" command basically overwrites your original unsorted .txt file with the file you just sorted.

    Voila! the entire operation just took about 10 seconds to accomplish and you didn't have to "open" any files. No copying and pasting. No browsing for a software program other than Word or Notepad to open a .txt file. No moving the file from one file format to another. No messing around. Just two simple commands from the Bash prompt and the entire job is complete, and since it doesn't require any gui resources it runs faster than a program requiring a gui.

    The *nix utilities and the Bash prompt just kick MS's butt on jobs like these, and a lot of others too.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1
  6. d-Faktor
    Honorary Member

    d-Faktor R.I.P - gone but never forgotten.

    810
    0
    39
    i don't want to spoil your moment, but sort is a windows command line tool as well.

    Code:
    sort.exe tosort.txt /o sorted.txt
     
  7. ffreeloader

    ffreeloader Terabyte Poster

    3,661
    106
    167
    LOL. Sure you did. You got a kick out of it.... So did I. :D I had forgotten all about the sort command in a cmd prompt. I never used it when running Windows, but the *nix utilities are something I use quite a bit, by choice.

    I guess it's because the DOS and cmd shells never made as much sense to me as the Bash prompt does. It just seems that that the Bash prompt is a far more intuitive shell and syntax to me. I spent more time trying to learn the cmd prompt and syntax than I have the bash prompt and syntax, and I have become more proficient with a Bash prompt than I ever was with the cmd prompt.
     
    Certifications: MCSE, MCDBA, CCNA, A+
    WIP: LPIC 1

Share This Page

Loading...