forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[resolved] Sort within a sort (within a sort (etc.))

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Feb 05, 2004 6:28 pm    Post subject: [resolved] Sort within a sort (within a sort (etc.)) Reply with quote

I am having a big problem and my brain hurts!

I have data and I want to sort a colum then sort by another column while keeping the first colum still sorted. In effect sorting within a sort. Does anyone have an idea or code on how to do this. Here is exactily what I want to do.

This is an entry in a log:

2531.023,02/05/2004,10:45 AM,dyost,11,Billable,B & W,Bond,30x42,1,Transportation,

There are MANY entries like this in the file. I need to sort column 1 then within that sort by column 9 then within that by 10.

Any help would be very.....well....helpfull!!

Thanks Much!

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Feb 05, 2004 6:41 pm    Post subject: Reply with quote

I think you should check if the first column you want to sort on, is the same as the first column of the previous item. If so, sort it on the second column as well. If not, continue to the next item...
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Feb 05, 2004 6:46 pm    Post subject: Reply with quote

Well, It's not that easy. I was hoping someone had already done this. I am pulling my hair out. I am on a tight deadline. Crying or Very sad
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Thu Feb 05, 2004 7:03 pm    Post subject: Reply with quote

Maybe you can find a little example from another programming language, which you can convert to VDS?
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Thu Feb 05, 2004 7:14 pm    Post subject: Reply with quote

Some time ago, I found a utility called TextTools. They are just a collection of command-line utilities for manipulating text data files. I tested them out and they were blindingly fast and seemed handy, but I never had a use for them.

In your case, you could output your list to a file with values separated by whichever character you like. Then invoke the sorting utility (which will sort by as many columns as you like) and then bring the output file back in - voila - your multiple-sorted list.

Here is the main page:

http://home.online.no/~runeberg/tt/tthome.htm

and here is the specific utility I'm talking about:

http://home.online.no/~runeberg/tt/tsort.htm


I always thought these would work very well with VDS since they both can use character-delimited data files.

Hope it is helpful -

_________________
Joe Floyd
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Feb 05, 2004 7:22 pm    Post subject: Reply with quote

Where do I DL it? I can't find a link. Sad
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Feb 05, 2004 7:25 pm    Post subject: Reply with quote

Found it! Thanks much!!
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Thu Feb 05, 2004 7:26 pm    Post subject: Reply with quote

http://www.simtel.net/product.download.mirrors.php?id=6431

from this page, about halfway down:

http://home.online.no/~runeberg/tt/tthome.htm#intro


There also appear to be some updates to install from the page above.

_________________
Joe Floyd
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Thu Feb 05, 2004 7:27 pm    Post subject: Reply with quote

Technically I guess I should give this URL:

http://home.online.no/~runeberg/tt/tthome.htm#download

_________________
Joe Floyd
Back to top
View user's profile Send private message
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Thu Feb 05, 2004 7:29 pm    Post subject: Reply with quote

Just saw your message - hope it works. Let me know if it does, I'll be interested. Might have a use for it myself sometime.
_________________
Joe Floyd
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Feb 05, 2004 7:32 pm    Post subject: Reply with quote

I'll let you know, cause if it doesn't, I gotta keep looking.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Thu Feb 12, 2004 3:37 pm    Post subject: Reply with quote

Did you ever get a chance to try this out? How did it work?
_________________
Joe Floyd
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Feb 12, 2004 3:41 pm    Post subject: Reply with quote

Sorry, Yes it works very nicely for my application. Thanks again.
_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group