Thanks.. "row_number" works
But now the problem is I want the verb to iterate over one array at a time.
for example if I do proccess"0(1+i.2) the resultant input is:
/home/user/input/filename1.pgm
/home/user/input/filename2.pgm
what I want is to "separately" process each array. In the first iteration I
want it to go for
/home/user/input/filename1.pgm
and when the process finished for the first iteration it goes for the second
one:
/home/user/input/filename2.pgm
and etc. like a loop.
I changed what you've wrote little bit:
process=: 3 :0
index =. > y
input=. '/home/filename',":index
input=. input,'.pgm'
input
)
process"0(,.<"1 ,.(i.2))
but still doesn't go for one array at a time, did you get what I mean?
Raul Miller-4 wrote:
>
> If I understand what you wrote, you want something like this:
>
> require'files'
> process=: 3 :0
> row_number=. ":y
> input=: fread '/home/user/input/filename', row_number ,'.pgm'
>
> NB. insert here, some calculations which define output as a sequence
> of characters
>
> assert. 1=#$output
> assert. ' ' ={.0#output
> output fwrite '/home/user/output/filename', row_number ,'.pgm'
> )
>
> proccess"0(1+i.50)
>
> The result here will be a list of length 50, representing the number
> of bytes written to each of these files (_1 for any case where the
> write was unsuccessful).
>
> --
> Raul
>
>
--
View this message in context:
http://old.nabble.com/path-variable-in-loop-tp34413608s24193p34419475.html
Sent from the J Programming mailing list archive at Nabble.com.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm