There are pitfalls when using clipboard to read data from spreadsheet. One is that numeric data representation depends on locale used. eg, the number 12345.67 can be read as '12 345,67' in the french locale.
ven, 08 Jan 2010, Andrew Nikitin skribis: > > Bill, > > > To get data from spreadsheets quickly I sometimes use the following verbs: > > > require 'strings' > tabget=:([: <;._2 ,&TAB);....@wdclipread > tabnget=:".@(rplc&'-_')@>@tabget > NB. formats J data in Excel ready form > tabfmt=:3 : 0 > if. 0=L. y. do. y.=.<"0 y. end. > '_-' rplc~ >([ , LF"_ , ])each/([ , TAB"_ , ])&": each/"1 y. > ) > tabput=:wdclipwr...@tabfmt > > > You select range in spread sheet, copy it to clipboard, then switch to J and > then say > > > a=.tabget '' > or > > a=.tabnget '' > > > tabget returns boxed array of strings, > > tabnget returns numeric array. > > > When you need to copy put data in spreadsheet use tabput: > > > tabput i. 3 4 > > > then switch to spreadsheet and press Ctrl-V > > > (tabput formats array and puts the formatted result on clipboard) > > > It works with Excel and Google docs spreadsheet, I am sure other spreadsheets > follow same clipboard convention. > > > _________________________________________________________________ > Hotmail: Free, trusted and rich email service. > http://clk.atdmt.com/GBL/go/196390708/direct/01/ -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
