1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

javascript delimited column sort

Discussion in 'Software Development' started by trix1210, Sep 27, 2008.

Thread Status:
Not open for further replies.
Advertisement
  1. trix1210

    trix1210 Thread Starter

    Joined:
    Sep 27, 2008
    Messages:
    8
    Thanks for reading..

    I have a file called recs.js

    It contains many records like this (each on a new line):

    A("TV1219|cent53t|10 Revolutions|Time For The Revolution|incentive|5|trance|08/2003|3");
    A("TV150|12txr004|2 digital|because of my dreams|triple xxx recordings|10|house|zz/1999|2");
    A("TV1007|12tiv-32|2 in a room|Ahora Es (Now Is The Time)|positiva|5|house|zz/1995|5");
    A("TV1271|12sbk 19|2 in a room|wiggle it|sbk records|7|oldskool|zz/1990|3");
    A("TV513|nebdj059|4 strings|turn it around|nebula|5|dance|zz/2004|2");


    The field data are separated by the bar character (|)

    The fieldnames are: product code, catnum, artist, title, label, price, genre, release, numtrax.

    (A is a function which I call which loads the data into an array)

    I need a function I can call which will sort by whichever column the user chooses i.e. title or label.

    Any help greatly appreciated!

    Trixy
     
  2. IMM

    IMM

    Joined:
    Feb 1, 2002
    Messages:
    3,257
    Are you trying this with a 1 dimensional array or have you loaded it into a 2D array ?
     
  3. trix1210

    trix1210 Thread Starter

    Joined:
    Sep 27, 2008
    Messages:
    8
    one dimensional
     
  4. IMM

    IMM

    Joined:
    Feb 1, 2002
    Messages:
    3,257
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/753930

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice