speedi Posted July 18, 2008 Share Posted July 18, 2008 I have not been able to do this.. I tried script writer but that didn't go very well.. I have a list of stock symbols that I can paste into a text editor (like notepad). I want to sort the symbols (seperated by a space)... Any help would be appreciated.... I think I would need to use an array, but have little experience with arrays... Symbols list follows: USSE SSTP AAPL APC APD ATHN CSCO CFX ED FWLT GDTI GLW GRMN GRWT MDR NOV NXSL OC OSUR PBR PRGN SBLK SXRZF WMT YHOO MSFT XMSR AMZN GOOG CELG COST CPRT EBAY HAL ICE ISRG LRY NHWK OMTR RIMM BIDU ROSE ACI PLT BRS Link to comment Share on other sites More sharing options...
JFee Posted July 18, 2008 Share Posted July 18, 2008 Typically you would want to use something like a TAB or Comma, but for this spaces will be fine. I wouldn't even bother copying into notepad... just read from the clipboard with ClipGet, and you'll get that string. Then you can use StringSplit to create an array of all of the symbols. How do you want to sort it? Regards,Josh Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 18, 2008 Share Posted July 18, 2008 #include <Array.au3> Global $str = 'USSE SSTP AAPL APC APD ATHN CSCO CFX ED FWLT GDTI GLW GRMN GRWT MDR NOV NXSL OC OSUR PBR PRGN SBLK SXRZF WMT YHOO MSFT XMSR AMZN GOOG CELG COST CPRT EBAY HAL ICE ISRG LRY NHWK OMTR RIMM BIDU ROSE ACI PLT BRS' Global $str_A = StringSplit($str, ' ') _ArraySort($str_A) ConsoleWrite('!' & _ArrayToString($str_A, ' ', 1)) Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
speedi Posted July 18, 2008 Author Share Posted July 18, 2008 Typically you would want to use something like a TAB or Comma, but for this spaces will be fine.I wouldn't even bother copying into notepad... just read from the clipboard with ClipGet, and you'll get that string.Then you can use StringSplit to create an array of all of the symbols.How do you want to sort it? Wow! That was fast!! sort alphabetically Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 18, 2008 Share Posted July 18, 2008 Wow! That was fast!! sort alphabeticallyThe answer is already there. How fast was that? muttley Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
JFee Posted July 18, 2008 Share Posted July 18, 2008 Like Xeno said... _ArraySort($str_A) Regards,Josh Link to comment Share on other sites More sharing options...
speedi Posted July 18, 2008 Author Share Posted July 18, 2008 Like Xeno said... _ArraySort($str_A)OK here is my script that DID NOT work - it displayed symbols unsorted....#include <Array.au3>$symbols = ClipGet()$array = StringSplit($symbols, ' ', 1)_ArraySort($symbols)MsgBox(4096, "Test", $symbols) Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 18, 2008 Share Posted July 18, 2008 #include <Array.au3> Global $array = StringSplit(ClipGet(), ' ', 1) _ArraySort($array) MsgBox(4096, "Test", _ArrayToString($array, ' ' , 1)) Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
speedi Posted July 18, 2008 Author Share Posted July 18, 2008 #include <Array.au3> Global $array = StringSplit(ClipGet(), ' ', 1) _ArraySort($array) MsgBox(4096, "Test", _ArrayToString($array, ' ' , 1)) well I am learning. That works, but I can't get it back into the clipboard.. I tried ClipPut(_ArrayToString($array ' ' , 1)) but I get an error.... Link to comment Share on other sites More sharing options...
JFee Posted July 18, 2008 Share Posted July 18, 2008 Was it a syntax error? Your code was a little off: ClipPut(_ArrayToString($array, ' ')) Regards,Josh Link to comment Share on other sites More sharing options...
speedi Posted July 18, 2008 Author Share Posted July 18, 2008 Was it a syntax error? Your code was a little off: ClipPut(_ArrayToString($array, ' ')) yes it was syntax and I see what I had wrong!!! Job is done correctly now and I thank you and others for help..... Link to comment Share on other sites More sharing options...
Xenobiologist Posted July 18, 2008 Share Posted July 18, 2008 yes it was syntax and I see what I had wrong!!! Job is done correctly now and I thank you and others for help.....No problem, I suppose there will come up some new problems soon. muttley Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
JFee Posted July 18, 2008 Share Posted July 18, 2008 And you will probably post the answer before the question is even asked muttley Regards,Josh Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now