Is there a script to automatically sort out a list alphabetically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Clean_Franck
    So Fucking Banned
    • Jan 2007
    • 399

    #1

    Is there a script to automatically sort out a list alphabetically

    here is the format my links are in:
    http://www.freeporn.com/iehwih - Free Porn for you
    http://www.freeporn.com/8uy98 - A best porn
    http://www.freeporn.com/qwq23 - Zach porn
    Is there a way to sort them alphabetically from the beginning of the descriptions, not the link?

    CF
  • Trixxxia
    Confirmed User
    • Aug 2004
    • 5600

    #2
    mmm Excel?

    Put the link in one column, the description in another
    highlight the entire page and click Data Sort by Column B
    Last edited by Trixxxia; 07-24-2008, 10:57 AM. Reason: elaborating

    Comment

    • ADL Colin
      Too lazy to set a custom title
      • Feb 2001
      • 11929

      #3
      http://www.freeporn.com/8uy98 - A best porn
      http://www.freeporn.com/iehwih - Free Porn for you
      http://www.freeporn.com/qwq23 - Zach porn

      glad I could help


      Adult Date Link - $50 PPS starting NOW! -- good and JUICY!

      skype = "adultdatelink"

      Comment

      • Linguist
        Confirmed User
        • Apr 2004
        • 1706

        #4
        in shell: swap links with descriptions, sort alphabetically, swap back
        in php/python/etc: make an array of pairs, sort by description
        in sql: insert into table, select and order by description

        excel works too
        edit: to do it in excel you'll wanna mass replace "-" with "," before opening the file
        Last edited by Linguist; 07-24-2008, 11:33 AM.
        315-310

        Comment

        • AnniKN
          Confirmed User
          • Feb 2008
          • 1682

          #5
          If you have the links in a list exactly the way you posted (as in, not really in two columns) paste in a text file, and do a replace of " - " for a tab, and then paste it in Excel like Trixxxia said, after sorting, copy again, paste again and replace TAB for " - "

          Comment

          • tranza
            ICQ: 197-556-237
            • Jun 2003
            • 57559

            #6
            Originally posted by Trixxxia
            mmm Excel?

            Put the link in one column, the description in another
            highlight the entire page and click Data Sort by Column B


            What she said.
            I'm just a newbie.

            Comment

            • fallenmuffin
              Confirmed User
              • Nov 2005
              • 8170

              #7
              Quick PHP solution I wrote for you.

              Code:
              <?php
              
              /**
               * Link Sort 
               *
               * @author  Fallen Muffin Media <[email protected]>
               */
              
              $filePath = 'links.txt';
              
              $links = file($filePath);
              
              foreach($links as $link) {
                $linkFrag = explode(' - ', $link);
                $descArray[] = array($linkFrag[1], $linkFrag[0]);
              }
              
              sort($descArray);
              
              for ($i=0;$i<count($descArray);$i++) {
                echo '<a href='.$descArray[$i][1].'>'.$descArray[$i][0].'</a><br />';
              }
              
              ?>

              Comment

              • Antonio
                Too lazy to set a custom title
                • Oct 2001
                • 14136

                #8
                Originally posted by AnniKN
                If you have the links in a list exactly the way you posted (as in, not really in two columns) paste in a text file, and do a replace of " - " for a tab, and then paste it in Excel like Trixxxia said, after sorting, copy again, paste again and replace TAB for " - "
                that's what I do all the time (importing fhgs with descriptions and thumbs) but I use Access, it feels so much easier but that's probably besause I'm not too familiar with Excel, I've tried it a few times but it looks pretty awkward

                Comment

                • Trixxxia
                  Confirmed User
                  • Aug 2004
                  • 5600

                  #9
                  Originally posted by Antonio
                  that's what I do all the time (importing fhgs with descriptions and thumbs) but I use Access, it feels so much easier but that's probably besause I'm not too familiar with Excel, I've tried it a few times but it looks pretty awkward
                  **oops forgot the put in the replace part

                  Everyone tells me Access is easier, but for the life of me, I'm lost with it so Excel is my friend.

                  Comment

                  Working...