I wanted to respond to your preface, while I’m a little younger than you I no longer make my living writing code. I adopted J as my personal use programming language. I don’t always have the time I want to put aside for my pet projects and I always seemed to be forgetting how to do things I researched a week or 2 before. So I got a hard bound notebook and started writing J phrases I found useful in the notebook. Now the notebook became unwieldy in a couple of months. I kept having to search multiple pages to find what I wanted. So I dedicated pages in the back of the book to form an index. In years of part time use of J I have about 166 pages filled with J stuff and phrases. I have over 110 entries in the index (S and R seem to need the most room in my way of filing). Between the forum archive search, my notebook, and searching the J website I can muddle along without bothering anyone.
I usually use a fresh page for my new phrase and give it a title based on what I am trying to do at the time. I then make multiple entries in the index when I’m done the J nomenclature for the phrase that found when searching, My nomenclature when I thought of what I was trying to do. I may make other entries based on the J symbols used. As an aside I found the answers already given in my notebook on Page 13 entitled “Selecting Elements Based on an Array of 1’s and 0’s”. It also mentions that # has a more general ‘copy’ function 0 1 0 1 # 0 1 2 3. NB. Obtain 1 copy of the selected item 1 3 0 2 0 1 # 0 1 2 3. NB. Obtain 2 copies of the selected items 1 1 3 3 Also in my index under selecting on Page 33 I describe item amend where you use a table of 1’s and 0’s to selectively update a table. <binary table> } <my table>,: <replacement value> Tom McGuire Still advanced beginner status after many years of playing with J > On May 19, 2020, at 7:27 AM, HH PackRat <[email protected]> wrote: > > Feel free to skip this apologetic preface that applies to all questions I ask: > > By way of excuse, I'm 74, and my memory has been failing little by > little over the last number of years. I looked at some J code I had > written 8-12 years ago and was astounded at what I used to be able to > do--nothing major, mind you, but yet good, decent code! I've been > sort of a lifetime "beginner" since 2006 (maybe reaching "advanced > beginner", if there is such a thing!), doing programming on and off as > I have need (which also doesn't help the memory). However, comparing > what I wrote years ago with what I struggle with now is showing that > my memory of what certain J primitives and combinations do is slipping > with time. (Years ago I wrote my own beginner-level task-organized > vocabulary of the kinds of things I typically need to do in my > particular programming interests, and I heavily depend upon that until > I run into something where the issue is not addressed in my > compilation.) So, please bear with me when I ask questions with > simple answers that you may think everybody should already know. I've > been a hobbyist programmer since 1975, mostly with versions of BASIC. > (I started with a MITS Altair PC and Microsoft's original BASIC. A > good number of years ago I asked Bill Gates to autograph my manual for > that BASIC since he wrote the code.) But times have changed, and now > I simply LOVE working with the J language because it fits my needs so > well in developing relatively simple programs (without writing all > those loops!), especially for dealing with data and such in my stock > market (and other) interests. I have no need to make my code tight, > fast, or short, as perhaps most of you need to do in your work--for > me, it just has to work correctly! > > After all that, finally, my QUESTION: > > J has all sorts of ways of creating, assembling, disassembling, > selecting, changing, and finding data in atoms, lists, and tables. > However, in no index of any of my books or ebooks about J, nor in the > (old) Vocabulary, nor in NuVoc have I been able to find how to DELETE > tables or any of their rows. > > For example, here is the cleaned up (of double quotation marks) > beginning of unusually-formatted data from a particular data source > that I'm trying to reformat according to standard: > > +---------|-----------|-- > |May 08|May 07| > +---------|-----------|-- > | 2020 | 2020 | > +---------|-----------|-- > | 664.35| 652.35| > +---------|-----------|-- > | 660.21| 653.00| > +---------|-----------|-- > | 664.56| 657.12| > +----------|----------|-- > | 657.67| 651.29| > +----------|-----------|-- > | - | - | > +----------|-----------|-- > | 1.84% | 1.19% | > +----------|-----------|-- > > I need to delete rows 0, 1, and 7--how to do that? (that is, leaving > a new table of rows, formerly 2 to 6, now 0 to 4) > > One thought I had was maybe to use some sort of boolean mask > expression using either 00111110 or its opposite 11000001. But, even > using that in some way, I still don't know how to physically get rid > of those rows, so that they don't exist any more. This question and > its answer is probably a "piece of cake" for most of you, but, right > now, the answer is not obvious to me. (After seeing one or more > answers, I'll probably say to myself, "Of course! I should have known > that!") > > By the way, just FYI, the first two deleted rows will be replaced with > the row that was created in the question in my previous message, but > that replacement is not what this question is dealing with--I'm rather > sure I can deal with that without help at this point. After that, > it's just a matter of moving one of the price rows to a different > position, converting the hyphens to zeros, and chronologically > reversing the data. I've never moved and inserted a row before, but I > think I'll be able to figure that one out. (If not, you know I'll be > back.) ;-) > > Again, thanks in advance for your help with this! > > Harvey > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
