ASP/VBScript to randomly select name from csv?

Discussion in 'ASP General' started by Scott Gordo, Mar 9, 2006.

  1. Scott Gordo

    Scott Gordo Guest

    <!--Newbie warning-->
    I've got a csv file with names, addresses, emails, etc.
    I've been asked to randomly select a name from a csv file.
    I've found plenty of RandNum examples, but I'm not sure how to apply it
    to these names.
    Can anyone point out a sample I could use?
    TIA!
    Scott
    Scott Gordo, Mar 9, 2006
    #1
    1. Advertising

  2. Scott Gordo

    Scott Gordo Guest

    Scott Gordo wrote:
    > <!--Newbie warning-->
    > I've got a csv file with names, addresses, emails, etc.
    > I've been asked to randomly select a name from a csv file.
    > I've found plenty of RandNum examples, but I'm not sure how to apply it
    > to these names.
    > Can anyone point out a sample I could use?
    > TIA!
    > Scott


    Sorry, buy RandNum I meant Randomize.
    /s
    Scott Gordo, Mar 9, 2006
    #2
    1. Advertising

  3. Scott Gordo

    MikeR Guest

    Scott Gordo wrote:
    > Scott Gordo wrote:
    >> <!--Newbie warning-->
    >> I've got a csv file with names, addresses, emails, etc.
    >> I've been asked to randomly select a name from a csv file.
    >> I've found plenty of RandNum examples, but I'm not sure how to apply it
    >> to these names.
    >> Can anyone point out a sample I could use?
    >> TIA!
    >> Scott

    >
    > Sorry, buy RandNum I meant Randomize.
    > /s
    >

    Read the file into an array. Use a random number (generated so that it
    is within the bounds of the array) to index into the array.
    MikeR
    MikeR, Mar 10, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Davy

    Select element from Set randomly?

    Davy, Aug 22, 2005, in forum: C Programming
    Replies:
    4
    Views:
    360
    Keith Thompson
    Aug 22, 2005
  2. Robert
    Replies:
    6
    Views:
    464
    Robert
    Aug 23, 2005
  3. haiwen

    can we randomly select mutiple days in calendar?

    haiwen, Oct 2, 2003, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    99
    Yan-Hong Huang[MSFT]
    Oct 6, 2003
  4. timstu
    Replies:
    6
    Views:
    159
  5. tamaker

    Select 4 records, Randomly from Database

    tamaker, Dec 12, 2007, in forum: ASP General
    Replies:
    3
    Views:
    148
    Dooza
    Dec 13, 2007
Loading...

Share This Page