Splitting strings 
Author Message
 Splitting strings

One of the most useful things in J is the way you can split strings
using different methods.

The explanations of this in the help texts are of course concise
and "clear" as anything else in J.

I highlight the "clear" part because the language used in J explanations
is not always so "clear" to ordinary readers.

You can look at it from different perspectives and when you finally
understand how things are explained you will find that it is correct
and clear and not intentionally trying to make things cryptic.

If you look at ";." which is "cut". It is extremely powerful operation.

Many people tend to try to build their own boxes when they could
read things into a locale and operate on them there. Use ";." to
split it up.

For the most common operations there is a utility "chop" that can be
used. It splits on linefeeds and spaces or an optional left argument.

For special cases like when you have a binomial string you want to
use for splitting an array you can use something like:

1 0 1 1 1 0 1 0 1 0<;.1   '1234567890'
or
1 0 1 1 1 0 1 0 1 0<;._1   '1234567890'

with the former you split the string and all the items are in the
boxes. With the latter you eliminate the items on the start of the
split.

The best thing to do is to experiment with these things until you
understand what the explanations were trying to tell you. After a
while you begin to understand and then each new item will be easier.

I am missing a dictionary that can be used for ordinary people so
they can understand the J dictionary.

I am sure people can write gigabytes of books to explain certain
aspects of J that they have crammed down into a few pages.

My recommendation to people is to start out with simple things. Ask
others. Read the utils. At least some of them are well explained.

Once you have got enough understanding to solve easy things you
gradually will begin to appreciate the possibilities you have at your
fingertips.

APL is concise and efficient. J is even more so.

--
/Gosi

562 5441
http://www.*-*-*.com/



Fri, 11 Sep 1998 03:00:00 GMT  
 Splitting strings

Quote:

>One of the most useful things in J is the way you can split strings
>using different methods.

>[rest of 57 line article deleted...]

Bj?rn, as long as the J crowd is going to hang out in the APL
newsgroup/list, could you please include in your subject header what
language the posted article is about? I had to download this article, only
to find out that it wasn't about APL.

Thanks, Don.



Fri, 11 Sep 1998 03:00:00 GMT  
 Splitting strings

Quote:

>One of the most useful things in J is the way you can split strings
>using different methods.
> I had to download this article, only
> to find out that it wasn't about APL.
> Thanks, Don.

It is always a pleasure to see that someone is making an effort to
read my articles.

I will be sure to send in a lot to give you the pleasure of learning
more about J.

I am sure that when you have read a few more you will begin to
understand it and love it.

You might even make a J verb to download the articles for you to
analyse their content and play a little music for you and give you
a hint want the contents are.

--
/Gosi

562 5441
http://www.jsoftware.com



Sat, 12 Sep 1998 03:00:00 GMT  
 Splitting strings
:
: ... APL is concise and efficient. J is even more so.
:

But it does not logically follow from that (true) statement that the
documentation for J should likewise be ultra-concise!

--

  Mathematics & Statistics Dept.            Voice:  413-545-2859 (W)
  University of Massachusetts                       413-549-1020 (H)
  Amherst, MA 01003                           Fax:  413-545-180



Sat, 12 Sep 1998 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. splitting strings with more than one splitting char

2. Splitting strings

3. split string by chars

4. Awk question re splitting strings

5. Splitting String into smaller parts????

6. Writing, reading, and splitting strings of binary

7. Writing, reading, and splitting strings of binary

8. Split string

9. help splitting strings

10. Splitting strings

11. Split string

12. splitting string

 

 
Powered by phpBB® Forum Software