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

Any Software That Could Help me Sort List of Numbers?

Discussion in 'BlackHat Lounge' started by agag2, Oct 9, 2011.

  1. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    Hi

    I have a task to do and looking for something (software) that could help me w this ill do my best to explain the task


    if i had a list of numbers (random) like
    4
    7
    2
    3
    4
    6
    4
    2
    1
    7
    4

    and i wanted to make a chart where each number comes up next - in the example above it would be (if 4 on the bottom is first)
    4
    7
    2
    3
    4 - 4
    6 - ?
    4 - ? <
    2 - 5 |
    1 - ? |
    7 - 8 |
    4 - 4 ^


    so the software should be able to spit out the number on the right - that number being the number it came up again like 4 came up 4 later so it would be 4 on the right


    I would have a list of 1000 + numbers.


    I hope i did a good job explaining my need.. otherwise pls let me know

    is there a software/way to accomplish this?

    thanks
     
  2. DebtFreeMe

    DebtFreeMe Regular Member

    Joined:
    Mar 14, 2010
    Messages:
    418
    Likes Received:
    363
    Occupation:
    Military
    Location:
    Earth
    You could put together a function in excel that will do this.

    Is the next answer for the 4, 2?

    If so you could definitely do this in excel...
     
    • Thanks Thanks x 1
  3. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254

    yup

    how would I do this w excel pls? (could it be done in openoffice too?0

    thanks
     
    Last edited: Oct 9, 2011
  4. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    can anyone lead me in the right direction? Im new to excel
     
  5. zero-day

    zero-day Regular Member

    Joined:
    Aug 25, 2011
    Messages:
    349
    Likes Received:
    344
    Occupation:
    Coder
    Location:
    My Office.
    Home Page:

    I don't know what exactly your asking, BUT, whatever MS suite can do, open office can do. For OpenOffice, you would use "OpenOffice Spreadsheet" (its the same as MS excel)
     
  6. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254

    Ill give another example say I had a list of numbers - on the left side
    8
    4
    2
    3
    5
    7
    3
    2 <<<<
    5
    8 - 9
    9 - ?
    2 - 4 <<<


    and I now fill in the right side. Starting from the bottom and going upwards we see "2" the next time "2" is mentioned is 4 later so on the left side i would fill in 4 (see in blue) the same is w 9 - but since its not menioned in this list we go on to the next 8 would be 9 etc etc etc


    I hope you understand what i mean now

    thanks
     
  7. DebtFreeMe

    DebtFreeMe Regular Member

    Joined:
    Mar 14, 2010
    Messages:
    418
    Likes Received:
    363
    Occupation:
    Military
    Location:
    Earth
    agag2, see my PM to you about using vlookup and match. It should help you.

    Good luck
     
    • Thanks Thanks x 1
  8. confined

    confined Regular Member

    Joined:
    Jan 4, 2009
    Messages:
    216
    Likes Received:
    91
    not tested but here ya go
    doesnt go from bottom up but it achieves the same result

    PHP:
    <?php
    if(ISSET($_POST['text'])){
        
    $data explode("\r\n",$_POST['text']);
        
    $cd count($data);
        
    $v =array();
        for(
    $i=0;$i<$cd;++$i){
            if(ISSET(
    $v[$data[$i]])){
                
    $s' - ' . ($i-$v[$data[$i]]).'<br />';
                
    $v[$data[$i]] = $i
            }else{
                
    $v[$data[$i]] = $i;   
                
    $s='<br />';
            }
            echo 
    $data[$i] . $s;
        }
    }else{
     echo 
    '<form action="" method="POST">
     <textarea name="text" rows=30 cols=50>8
    4
    2
    3
    5
    7
    3
    2
    5
    8
    9
    2</textarea>
     <input type=submit name=submit value=calc />
     </form>'
    ;
    }
    ?>
     
    • Thanks Thanks x 2
  9. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    thanks for the code but i just tried it and it does not out put the correct numbers

    here's what i got
    8
    4
    2
    3
    5
    7
    3
    2
    5
    8
    9
    2


    2 should be 4 .....
     
  10. ab-dl

    ab-dl Newbie

    Joined:
    Apr 11, 2011
    Messages:
    6
    Likes Received:
    1
    the php code didnt work for me either
     
  11. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    this just spits out the same numbers again? Is there a mistake here?
     
  12. confined

    confined Regular Member

    Joined:
    Jan 4, 2009
    Messages:
    216
    Likes Received:
    91
    I don't get what you guys are having problems with, it works fine for me, http://testingbhw.comlu.com/test.php

    it goes from top down, maybe it isn't what you want, but i digress it's not worth the time
     
    • Thanks Thanks x 1
  13. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254


    This one is good - thanks given
     
  14. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254

    site offline now