'\in1';'\in2' is a list of two input directories; '\out1';'\out2' are
two output directories.

On Mon, Sep 10, 2012 at 4:34 PM, pascha <amirpasha...@gmail.com> wrote:
>
> If I understood correctly you've included two 'inputd' and two 'outputd' and
> a table which makes it rather complicated for me. If that is right could you
> make it for one 'inputd' and one 'outputd' and a table?
> if I am worng what are 'in1','in2' and 'out1' and 'out2'?
>
>
> Devon McCormick wrote:
>>
>> Here are a couple of ways to do what you want.  Each of these expects
>> a triplet (input dir; output dir; table) and an arbitrary verb to
>> apply.
>>
>> workOnDirs=: 1 : 0
>>    'inpd outpd table'=. y
>>    table u inpd;outpd
>> NB.EG foo workOnDirs &.> ('\in1';'\in2');&.>('\out1';'\out2');&.>tables
>> )
>>
>> So, the input data for this would be something like this:
>>
>>    ('\in1';'\in2');&.>('\out1';'\out2');&.>(<2 2)$&.>1 0;1 2 3
>> +----------------+----------------+
>> |+----+-----+---+|+----+-----+---+|
>> ||\in1|\out1|1 0|||\in2|\out2|1 2||
>> ||    |     |1 0|||    |     |3 1||
>> |+----+-----+---+|+----+-----+---+|
>> +----------------+----------------+
>>
>> loopyWay=: 1 : 0
>>    'inpd outpd table'=. y
>>    for_ix. i.#inpd do. table foo (ix{inpd);ix{outpd end.
>> NB.EG foo loopyWay ('\in1';'\in2');&.>('\out1';'\out2');&.>tables
>> )
>>
>> The input data for this would be like this:
>>
>>    ('\in1';'\in2');('\out1';'\out2');(<2 2)$&.>1 0;1 2 3
>> +-----------+-------------+---+---+
>> |+----+----+|+-----+-----+|1 0|1 2|
>> ||\in1|\in2|||\out1|\out2||1 0|3 1|
>> |+----+----+|+-----+-----+|   |   |
>> +-----------+-------------+---+---+
>>
>> The first of these is more J-like as it doesn't loop explicitly.
>> Also, the second one doesn't show the relation between the three lists
>> whereas the first one groups them more naturally. These examples
>> assume "foo" takes a left argument of the table you want to use and a
>> right argument of the input;output directories.
>>
>>
>
> --
> View this message in context: 
> http://old.nabble.com/path-variable-in-loop-tp34413608s24193p34415240.html
> Sent from the J Programming mailing list archive at Nabble.com.
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to