Page 1 of 1

sort lines in text field

Posted: Wed Oct 23, 2013 10:59 am
by doloop
I have downloaded Yahoo historical price data and placed it in a variable named "buffer1". Yahoo data is in reverse chronological order. I want the data in chronological order.

Here are the first three lines of the data:

2013-10-22,25.50,26.12,25.43,26.02,53407700,26.02
2013-10-21,24.47,24.97,24.43,24.93,27049900,24.93
2013-10-18,24.52,24.77,24.30,24.38,23734800,24.38

As you can see the 1st item of each line is the date. I used the following command to resort the data, but it does not work:

sort lines of buffer1 ascending dateTime by item 1 of each

What am I doing wrong?

Re: sort lines in text field

Posted: Wed Oct 23, 2013 11:31 am
by snm
Item 1 is not dateTime in your variable - you have only text there.

Code: Select all

sort lines of buffer1 ascending by item 1 of each
This works with your data in variable.
Marek

Re: sort lines in text field

Posted: Wed Oct 23, 2013 1:36 pm
by doloop
That works! Thank you. :D

Re: sort lines in text field

Posted: Wed Oct 23, 2013 1:54 pm
by snm
You are welcome.

Marek