Is it possible to do this?
I have everyday 2 csv files that I need to figure a simple composite score in Numbers via applescript) that outputs new re-sorted 3rd Numbers sheet by new composite score.)
Every stock symbol has known score in the 1st csv:
(Following are already scored 1-12 usually 6000 different stock symbols)
“No.”,“Ticker”,“Company”,“Sector”,“Industry”,“Country”,“Market Cap”,“P/E”,“Price”,“Change”,“Volume”
1,“BPT”,“BP Prudhoe Bay Royalty Trust”,“Basic Materials”,“Oil & Gas Refining & Marketing”,“USA”,2339.66,12.26,109.33,0.95%,75598
2,“PBT”,“Permian Basin Royalty Trust”,“Financial”,“Diversified Investments”,“USA”,1026.35,15.96,22.02,1.80%,190976
3,“SBR”,“Sabine Royalty Trust”,“Financial”,“Diversified Investments”,“USA”,885.01,15.93,60.70,1.08%,9630
4,“MSB”,“Mesabi Trust”,“Financial”,“Diversified Investments”,“USA”,328.79,10.71,25.06,3.13%,67290
5,“NRT”,“North European Oil Royalty Trust”,“Financial”,“Diversified Investments”,“USA”,301.16,14.19,32.77,0.77%,14990
6,“SJT”,“San Juan Basin Royalty Trust”,“Financial”,“Diversified Investments”,“USA”,1130.29,17.20,24.25,1.63%,81551
7,“MARPS”,“Marine Petroleum Trust”,“Financial”,“Diversified Investments”,“USA”,44.00,14.86,22.00,2.37%,3514
8,“PCO”,“Pendrell Corporation”,“Technology”,“Wireless Communications”,“USA”,615.61,1.99,2.37,3.49%,283468
9,“TNH”,“Terra Nitrogen Company, L.P.”,“Basic Materials”,“Agricultural Chemicals”,“USA”,3297.44,15.42,178.24,2.18%,61131
10,“GNI”,“Great Northern Iron Ore Properties”,“Basic Materials”,“Steel & Iron”,“USA”,158.46,7.60,105.64,-0.61%,2850
11,“ISIG”,“Insignia Systems Inc.”,“Services”,“Marketing Services”,“USA”,49.48,0.88,3.23,3.53%,46293
12,“ZIXI”,“Zix Corp.”,“Technology”,“Application Software”,“USA”,203.17,4.95,3.17,2.92%,307800
2nd csv has the stock symbols ranked possibly like this on a random day:
“No.”,“Ticker”,“Company”,“Sector”,“Industry”,“Country”,“Market Cap”,“P/E”,“Price”,“Change”,“Volume”
1,“ZIXI”,“Zix Corp.”,“Technology”,“Application Software”,“USA”,203.17,4.95,3.17,2.92%,307800
2,“SBR”,“Sabine Royalty Trust”,“Financial”,“Diversified Investments”,“USA”,885.01,15.93,60.70,1.08%,9630
3,“PBT”,“Permian Basin Royalty Trust”,“Financial”,“Diversified Investments”,“USA”,1026.35,15.96,22.02,1.80%,190976
4,“MSB”,“Mesabi Trust”,“Financial”,“Diversified Investments”,“USA”,328.79,10.71,25.06,3.13%,67290
5,“BPT”,“BP Prudhoe Bay Royalty Trust”,“Basic Materials”,“Oil & Gas Refining & Marketing”,“USA”,2339.66,12.26,109.33,0.95%,75598
6,“MARPS”,“Marine Petroleum Trust”,“Financial”,“Diversified Investments”,“USA”,44.00,14.86,22.00,2.37%,3514
7,“SJT”,“San Juan Basin Royalty Trust”,“Financial”,“Diversified Investments”,“USA”,1130.29,17.20,24.25,1.63%,81551
8,“PCO”,“Pendrell Corporation”,“Technology”,“Wireless Communications”,“USA”,615.61,1.99,2.37,3.49%,283468
9,“NRT”,“North European Oil Royalty Trust”,“Financial”,“Diversified Investments”,“USA”,301.16,14.19,32.77,0.77%,14990
10,“GNI”,“Great Northern Iron Ore Properties”,“Basic Materials”,“Steel & Iron”,“USA”,158.46,7.60,105.64,-0.61%,2850
11,“ISIG”,“Insignia Systems Inc.”,“Services”,“Marketing Services”,“USA”,49.48,0.88,3.23,3.53%,46293
12,“TNH”,“Terra Nitrogen Company, L.P.”,“Basic Materials”,“Agricultural Chemicals”,“USA”,3297.44,15.42,178.24,2.18%,61131
What I need is:
- Stock Symbols each get a new composite score:
So BPT for example would get a score of 6 (1+5)
ISIG would get a score of 22 (11+11) and so on.
TNH would get a score of 21 (9+12)
-
All rows with “Financial” or “Utilities” are stripped out.
-
Newly composite scored stock symbols are re-sorted ASCENDING
-
Outputted into a 3rd Numbers (sheet?) with Composite Ranks in the 1st column.
Thanks for taking a look, as I have no idea how to start this.
Model: Macbook Pro
Browser: Firefox 5.0.1
Operating System: Mac OS X (10.6)