NB. ver 1.1 //26/Nov/2005 //add charin by J.Takeuchi NB. =============================================== NB. Get EXCEL using OLE (use xlutil.ijs) getexcel=: 3 : 0 NB. J Client use ole to EXCEL Sever NB.Filename of Book is TEST and Sheet name is TRY NB. Usage: getexcel '' NB. Next usage: xlreadr 'foo.xls foo r c m n' NB. foo.xls is Bookname , foo is Filename NB. r c is start-adress of Excel 'r' is row, 'c' is column ( 1 1 is 1-A) NB. m n is size of matrix 'm' is number of row, NB. 'n' is number of column (30 2 is $ 30 2) NB. Ex. xlreadr 'foo.xls sheet1 1 1 30 3' (from 1-A and size is 30*3 matrix) NB. Ex. xlwriter ' foo.xls foo 1 1 3 4' writeback to Excel NB. start 1-A point ,write $ 3 4 matrix NB,------------------------------------------------------------------------ load 'system\examples\ole\excel\xlutil.ijs' NB. adjust your directry xlopen '' xlshow '' xlcmd 'wb add' xlcmd 'temp saveas TEST' xlget 'temp worksheets' xlid 'ws' xlget 'ws item sheet1' xlid 'sh1' xlset 'sh1 name TRY' xlcmd 'sh1 activate' ) NB.------------------------------------------------------------------------- NB. subsequent script is written by J.Takeuchi 1999 ,takeuchi@ae.keio.ac.jp datain=:3 : 0 NB. a=.datain 1 1 5 5 (1 1) denotes a location; (5 5) denotes a size (_2{.y.)$,".>xlreadr 'TEST.xls TRY ',":y. ) dataout=:4 : 0 NB. This Script is written by Juichiro.Takeuchi 1999 ,takeuchi@ae.keio.ac.jp NB. c dataout 6 6 (6 6) denotes a location of Excell Files x. xlwriter 'TEST.xls TRY ',":y. ) charin=: 3 : 0 NB. a=.char 1 1 5 5 (1 1) denotes a location; (5 5) denotes a size xlreadr 'TEST.xls TRY ',":y. ) 0!:0<'system\main\files.ijs' 0!:0<'system\main\stdlib.ijs' readtable=:[:>0:".&.>[:cutopen([: 1!:1 ])-.(13{a.)"_ writetable=:4 : '(,(":x.),"1 CRLF)1!:2 y.' NB.--------------------------------------------------------------------------- NB. Examples; makes a matrix file after reading NB. from Excell File "Sheet TRY" in "TEST.xls" NB. a=.datain 3 2 32 13 NB. a writetable<'d:\language\j406\temp\test.dat' NB.--------------------------------------------------------------------------- NB. usage: getexcel''