Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some urgent help with tcl comands

Status
Not open for further replies.

dm19

Technical User
Nov 4, 2014
1
US
Hi,

I would appreciate any help from you guys, I am a newbie to tcl

I am to print out few list which I am retrieving from different loops,

abc 1 3 4 xyz...
abc 2 4 5 sadas...
abc
abc.bcd
abc.bcd
abc
abc
abc
abc.xyz
....


How can I sort these lines such that I get
abc 1 3 4 xyz...
abc 2 4 5 sadas...
abc
abc
abc
abc
abc.bcd
abc.bcd
abc.xyz

Have tried doing lsort and other things, but I am not sure if that is the way.
I am fine with saving them in file and doing file operation, but would be preferable if I do that on tcl interface.
 
If lsort supplies the end result you need and you are not constrained by time issues of lists that are 100's of thousands long, then go with it. If you have huge lists and sorting speed is paramount, there are sites where you can find/review the various theories/algorithms on sorting. Bubble sort, loop sort, hash sort come to mind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top