Except deb"1 does not necessarily remove spaces.

Consider:
    $'a   b    c',:'example text'
2 12
    $deb"1 'a   b    c',:'example text'
2 12

The result has the same number of spaces as the original.  Except some
of them have been moved to the right:

    'a   b    c',:'example text'
a   b    c
example text
    deb"1 'a   b    c',:'example text'
a b c
example text

So, usually when people are manipulating multiple strings they will do
something different.

Meanwhile, when I want to see what I can get from require'strings' I
usually use open'strings'.  Except, that does not work under jhs
(because strings is automatically loaded so it can be safely ignored
by some of the file manipulating scripts).

-- 
Raul

On Tue, Nov 8, 2011 at 2:42 PM, Skip Cave <s...@caveconsulting.com> wrote:
> Yes, that is pretty much what I have been doing. With each step in my
> project, I determine what needs to be done, then I read the doc to see how
> to do it.Then I keep trying stuff untill I get it to work. One thing at a
> time.
>
> I haven't reported all my various explorations and incremental test steps,
> as those are probably not of interest to the forum. My explorations and
> tests were primarily to help me learn J. I only post to the forum when I
> get to a point where I can't find an answer to what I want to do.
>
> Unfortunately, the fact that J uses different nomenclature from other
> programming languages makes the functions and routines that do what I want,
> hard to find. I don't want to have to read the complete language doc to
> find how to manipulate strings, for example. Once I found the script files
> for string manipulation, they do give some examples. However, nowhere in
> the string doc does it explain that deb"1 is required to remove blanks for
> a multi-dimentional text array.
>
> I realize that J gurus understand all about the rank operator, but that
> kind of thing should be included in the examples for strings and other
> functions, so beginners don't have to stumble around trying to figure out
> why their functions don't work. Removing blanks from a multi-dimension
> array should be a standard example in the strings doc, both for boxed and
> unboxed arrays.
>
> I understand that the J vocabulary page contains a thorough definition of
> each function. However the vocabulary is quite terse, and requires
> knowledge of the format to decode. The vocabulary would benefit from a vast
> expansion of the examples for each entry.
>
> I find that I can learn a language much faster if I have a project to do,
> and I try to implement that project in the new language. I really
> appreciate the help that all the forum members give, when I ask a question.
>
> Skip
>
> 2011/11/8 Björn Helgason <gos...@gmail.com>
>
>> You can of course work on each element in a boxed string.
>>
>> If I were you and beginning to learn J I would concentrate on one thing at
>> a time.
>>
>> Collect all the strings together, write or add them out as lines in a
>> result file.
>>
>> In the next step you can read that intermediary result file and do the
>> operations you want on them.
>>
>> Once you have finished all the steps you can begin to refine each step or
>> eliminate as you see fit.
>>
>> Going in for heavy J stuff while learning J at the same time may not be the
>> best way to go.
>>
>> As you see you are getting expert advice as you go along so you probably
>> know by now that your work is doable in J and many people know how to do it
>> and have done similar things in the past.
>>
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to