I'm struggling to understand exactly what you are trying to achieve but am assuming it just involves processing a set of files. If so then something like this might work.
Create a 2 column table of outfilenames ,. infilenames. It doesn't really matter how you do this but for clarity here's an example: outpath=: 'path/out/' inpath=: 'path/in/' outfiles=: ((outpath,'outfile') , ,&'.txt') each 8!:0 ] i.3 infiles=: ((inpath,'infile') , ,&'.png') each 8!:0 ] i.3 outfiles,.infiles ┌─────────────────────┬───────────────────┐ │path/out/outfile0.txt│path/in/infile0.png│ ├─────────────────────┼───────────────────┤ │path/out/outfile1.txt│path/in/infile1.png│ ├─────────────────────┼───────────────────┤ │path/out/outfile2.txt│path/in/infile2.png│ └─────────────────────┴───────────────────┘ Then you want to process each row of this table. The verb processData is a placeholder for whatever processing you need to do to take the contents of the infile and produce the contents for the outfile. (fwrite~ processData@fread)/"1 outfiles,.infiles This is essentially doing the equivalent of the following for each pair of out and in files: 'out/path/outfile1.txt' (fwrite~ processData@fread) 'in/path/infile1.png' HTH On Tue, Sep 11, 2012 at 10:31 AM, pascha <amirpasha...@gmail.com> wrote: > > Yes, you're right. I said "one by one" cause I suppose the limitation doing > so. I get the so-called "limit error", (overly large resultant). That's why > I turned back to one-by-one manner. I am sure that you would find another > strategy to do so but that's the only way I can think of for the moment. > > Actually, in this procedure I call two verbs one for reading and one for > writing. The one that reads the data needs an 'input path' and the one that > performs the writing needs 'an output' path. In between I would call another > result (a table, fill with numbers) in which I would do some kind of > calculation and together with 'read input file' I feed the 'writing verb' > for the final result. > > And my point was how to write a verb that could read "input", "output", > "table" (one by one or row by row) and performs those actions (for 50 times, > depends on the number of inputs / outputs / rows of table ). > > or > > I could read only "the table" (row by row) and append the table's "row > number" at the end of input and output path name. > > > > > Raul Miller-4 wrote: >> >> Well... J does have control structures, though only in explicit verbs >> (and explicit adverbs and explicit conjunctions): >> http://www.jsoftware.com/help/dictionary/ctrl.htm >> >> That said, when you say "one by one" it's usually a good idea to say >> why you want to do things that way. "One by one" processing in J >> tends to be slow, so mostly it's a good fit for things that already >> take a while (then you can ignore the extra millisecond? needed to >> handle each item, one by one). File processing probably fits, >> though... >> >> Anyways, the way you are currently describing things, I think I would >> want to identify files by index number (1..50), and then I would have >> a verb that gives me the read file name for an index number and >> another verb that gives me the write file name for an index number. >> Then I could write a routine to process a file index and it could use >> these verbs to determine which file pair to work on. Or, if it was >> the only verb to deal with these files, maybe I would just hard-code >> the algorithm into the verb itself. >> >> But I might be failing to understand something important about your >> computations? >> >> -- >> Raul >> >> >> > -- > View this message in context: > http://old.nabble.com/path-variable-in-loop-tp34413608s24193p34415702.html > Sent from the J Programming mailing list archive at Nabble.com. > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm