> From: Alfonso Salazar > I found in the forum the next definition: > > NB. formats data in tabular form J acceptable by spreadsheets. > > > tabfmt =: 3: 0 > if. 0 = L. y. do. y. =. < "0 y. end. > '_-' rplc ~> ([LF "_]) each / ([TAB" _, each ])&": / 1 y.. > ) > > I don’t remember the author. > Someone could say me how it works and what is "rplc" which is in the > definition of tabfmt?
Björn already suggested to you what the rplc verb was and showed you how to find it in the thread you created on [email protected] Looks to me like the tabfmt basically creates a tab-separated string that you could copy to the clipboard or write to a file that could be read by Excel. The rplc verb is replacing the underscore character (_) used in J to denote negative numbers with the hypen or minus character (-) so that negative numbers are correctly interpreted by Excel. I would suggest the tables/csv or tables/dsv addons to create csv or tab-delimited files respectively. If you want a quick way to copy a matrix to Excel via the clipboard I have found the following useful. ClipCopy=: 13 : 'wdclipwrite ;(<@(,&CRLF)@}:@;)"1 (,&TAB) each 8!:0 y' ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
