dirpath test2
will give you a list of all the directories and subdirectories
starting at test2 (give a left argument of 1 if you only want
directories with files in them).
An easy way to apply a verb to each of them would be: define the verb
that does what you want (to save you from typing it out each time you
want to use it), and use it with a modifier like 'each'.
I can't test this, though, since ('starttag;'crlf,'endtag') seems to
not work. Also, I would define crlf to be crlftab if it is what I
think it is. Anyways, let's define a variable tags=:
'starttag;'crlf,'endtag' (replacing the expression with something that
works, then you should be able to do something like this:
>; <@:(deb"1&.>)@(tags&getTagContents)@shell each 1 dirpath test2
Note that I have glued together all the processing that happens on a
file, so happens on file contents one-by-one when the files are read
-- and then each of them goes in a box (so you get boxes of boxes of
text). And then at the end I merge the results from all files and
unbox them.
--
Raul
On Tue, Nov 8, 2011 at 2:02 PM, Skip Cave <[email protected]> wrote:
> That solves it!. This code does he trick
>
> aa =: deb"1 > ('starttag;'crlf,'endtag') getTagContents shell zipth,
> filepth
>
> aa
> This is the first string I want
> This is the second string I want
>
>
> Now for the last step. 'filepth' is currently:
>
> filepth
> c:\test3\log.gz
>
> My test3 directory had no sub-directories, just one log.gz file, for basic
> testing. My test2 directory has around 60 or so sub-directories, where each
> sub-directory contains one log.gz file. I made this test2 subset also for
> testing, as the real structure contains nearly 1000 sub-directories, each
> with a log.gz file.
>
> I need to apply the 'deb"1 > ('starttag;'crlf,'endtag') getTagContents
> shell zipth, filepth' verb to each of the subdirectories in the test2
> directory. How can I change the filepth noun to allow this iteration?
>
> Skip
>
> On Tue, Nov 8, 2011 at 12:31 PM, Raul Miller <[email protected]> wrote:
>
>> deb"1 aa
>>
>> But note that the result will then be padded on the right so that the
>> shapes match. If you do not want this, you will need to box the
>> result of deb:
>> <@deb"1 aa
>>
>> --
>> Raul
>>
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm