Making copy/paste between Excel & NARS2000 easier

Don't hold back

Making copy/paste between Excel & NARS2000 easier

PostPosted by doctorwes » Thu Mar 03, 2011 6:02 pm

I've been playing around with NARS2000. Typing in data by hand is tedious so I prefer to copy data from Excel worksheets. But copying & pasting data back and forth between Excel and a NARS2000 session is a bit of a pain because of the high minus signs used in APL, and because of the carriage returns that appear in text copied from an Excel range. The attached AutoHotkey script (www.autohotkey.com/) defines two hotkeys that make this less cumbersome (by making the necessary replacements in the clipboard text).



  • Copy range in Excel, Windows - space bar, paste into NARS2000 session: pastes the Excel data in the form of a vector, suitable for redimensioning back into a matrix; this looks funny when pasted into the session but it does work.

  • Copy matrix output in NARS2000 session, Alt - space bar, paste into Excel: pastes the matrix data as an Excel range (with a blank leftmost column, sorry about that).


NB: In order to work property, this script needs to be saved in UTF-8 encoding.





#space::


StringReplace,clipboard,clipboard,-,¯,All


StringTrimRight,clipboard,clipboard,1


StringReplace,clipboard,clipboard,`r`n,`,,All


return



!space::


StringReplace,clipboard,clipboard,¯,-,All


return



doctorwes
 
Posts: 2
Joined: Sun Feb 27, 2011 3:21 pm

Return to Open Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron