The windows J distribution includes unzip.exe in ~system/tools. Is this not adequate and easy to apply with one of the task utilities (which in unix wrap 2!:0 and in windows wrap an equivalent)?
On Thu, Nov 3, 2011 at 10:02 PM, Ric Sherlock <[email protected]> wrote: > Here is some J code that should give you the list of LOG files in the > directory tree. > ; (<empty'') -.~ (1 dir ,&'/LOG') each dirpath 'jsource' > > Next step to unzip. On Windows I'd imagine that 7z should handle gzip OK. > > On Fri, Nov 4, 2011 at 2:37 PM, Skip Cave <[email protected]> wrote: > > I was assuming I would do the job in J, but a comparison between the J > > approach and a shell script or other scheme, would be enlightening. My > > files and the 6.02 J interpreter are on a Win7 64-bit machine with 4 gig > of > > ram. > > > > Skip > > > > On Thu, Nov 3, 2011 at 8:05 PM, Eric Iverson <[email protected] > >wrote: > > > >> If done in J it would be done essentially identically on all platforms. > The > >> only little bit of host dependency would be calling unzip and I'm sure > >> forum members could help make that easy. > >> > >> On Thu, Nov 3, 2011 at 9:01 PM, Joey K Tuttle <[email protected]> wrote: > >> > >> > On 2011/11/03 17:50 , Skip Cave wrote: > >> > > I have several thousand files which are distributed into about a > >> thousand > >> > > folders. All of the folders are contained in one directory on my > >> machine. > >> > > Each of the thousand folders contains 1-10 files. All of the files > in > >> > each > >> > > folder have been compressed using the gzip program. I need to > sequence > >> > > through all of the folders, find the file in each folder labeled > "LOG" > >> > > (there will be only one in each folder, with no extension), and > expand > >> > it. > >> > > I then need to examine the expanded LOG file (ASCII text file) and > >> search > >> > > the LOG file for a specific unique text string that will be the > same in > >> > all > >> > > the LOG files. I need to extract the string of a few hundred > characters > >> > > that *follows* the initial matched string in the LOG file. That > second > >> > > string will be terminated by another (different& third) unique text > >> > string > >> > > which will also be the same in all LOG files. I want to place all of > >> the > >> > > extracted strings into a single boxed array using a single J > function. > >> > > > >> > > How hard is it to do this in J? Can someone give me a start in the > >> right > >> > > direction, perhaps with some example code? I currently only have J > 6.02 > >> > on > >> > > my machine. > >> > > > >> > What environment? If Linux or OSX, it's my kind of thing (seems quite > >> > reasonable, and I could have a go at providing example code) - but I > >> > have no knowledge of how to approach it in Windows.... > >> > > >> > - joey > >> > > >> > ---------------------------------------------------------------------- > >> > For information about J forums see > http://www.jsoftware.com/forums.htm > >> > > >> ---------------------------------------------------------------------- > >> For information about J forums see http://www.jsoftware.com/forums.htm > >> > > > > > > > > -- > > Skip Cave > > Cave Consulting LLC > > Phone: 214-460-4861 > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
