Kyma Forum
  Tips & Techniques
  how to sort numbers?

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   how to sort numbers?
SamuelSacher
Member
posted 14 January 2012 15:45         Edit/Delete Message   Reply w/Quote

somelist.txt

 
hi

Is there a simple solution (in Kyma or elsewhere on Mac, or PC) to sort a list of numbers written in a word processor document?

attached is demo list - as a illustration

how to order - sort them by "size"
(of course, 10,11, should be after 2 ...openoffice failed in that)

a son of my friend solved that in no time on linux, even explained (tried to) to me how it's done, in perfect geekish ...

any solutions for us mortals?

big thank you

s

IP: Logged

pete
Member
posted 14 January 2012 16:20         Edit/Delete Message   Reply w/Quote
Hi Samuel

Import them into Excel and it will sort no problem.

Pete

IP: Logged

pete
Member
posted 14 January 2012 16:44         Edit/Delete Message   Reply w/Quote

NumberSort.xls.zip

 
Hi Samuel

not quite so simple

after the import you will need to make a second column with formula

=VALUE(SUBSTITUTE(A1,"d hz","",1))

And then sort using that column

Pete


IP: Logged

photonal
Member
posted 15 January 2012 01:16         Edit/Delete Message   Reply w/Quote
or on OSX:

1) open up Terminal (in Utilities)

2) type "sort -n" (without the speech marks)

3) drag somelist.txt onto the terminal window

so you should now have something like:

andrew$ sort -n /Users/USERNAME/Desktop/somelist.txt

4) continue to type " > /Users/USERNAME/Desktop/somesortedlist.txt" (again without the speech marks)

5) hit return

This passes your somelist.txt file to the sort command with the -n (numeric sort) option and redirects the output to a new file called somesortedlist.txt.

Edit USERNAME according to your own username so that the path to the files are right.

[This message has been edited by photonal (edited 15 January 2012).]

IP: Logged

SamuelSacher
Member
posted 15 January 2012 04:38         Edit/Delete Message   Reply w/Quote
Thanx photonal!

well your explanation is very similar to the one I received for linux
which is no wonder, of course, it's nearly the same thing (osx)
I'll do my best to try and implement your instructions ..
just can't believe that this is so complicated action ...
that in bean or abeword or textedit there is no comand for this
sort by size
thank you again
maybe some day some good soul makes something in Kyma that will do the job

IP: Logged

SamuelSacher
Member
posted 15 January 2012 04:42         Edit/Delete Message   Reply w/Quote
and also ...
thank you Pete, but I don't have excel, and in openoffice, as I said, it doesn't work as it should (that 2 is before 10)
thank you for help anyway!

IP: Logged

pete
Member
posted 15 January 2012 04:59         Edit/Delete Message   Reply w/Quote

NumberSorted.txt.zip

 
Hi Samuel

Thats what the formula is for.

It turns the text into a number and stops 10 and 1 coming next to each other.

Attached is the results from the spread sheet.

Pete

IP: Logged

SamuelSacher
Member
posted 15 January 2012 07:32         Edit/Delete Message   Reply w/Quote
Hi Pete

o.k., I'll try the formula with openoffice when I install it on mac
so far it is only on my wife's linux machine

although it seems that I mastered the "terminal on osx" approach

thanx for helping me out people!

I knew that Kyma forum will find the solution

ss

IP: Logged

SamuelSacher
Member
posted 15 January 2012 07:37         Edit/Delete Message   Reply w/Quote
quote:
Originally posted by SamuelSacher:
Hi Pete

o.k., I'll try the formula with openoffice when I install it on mac
so far it is only on my wife's linux machine

although, it seems that I mastered the "terminal on osx" approach

thanx for helping me out people!

I knew that Kyma forum will find the solution

ss



IP: Logged

SamuelSacher
Member
posted 15 January 2012 07:39         Edit/Delete Message   Reply w/Quote
sorry for the last entry

my mistake ...

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c