June 3, 2009

LogParser unzip and parse

All credit for this goes to Gluegood Software who saw this as a problem a few months ago and released freeware to help solve it. I was excited about this, but when I tried it I kept getting errors relating to invalid checksum. You can find Here a slightly modified version of what Gluegood did. The basic idea is the same and the files added/modified were:
  • UninstallDotNetAsCom.bat (added)
  • Module1.vb (modified)
  • Class1.vb (modified)
  • Zip.vbproj (modified)
  • Archive Folder added to Zip project
Basic idea and more details can be found on the GlueGood site (as well as some other awesome tools). In short, you would do something like this:
LogParser.exe -i:COM "select * From 'Test.tar.bz2'" -iProgId:Gluegood.LogParser.ZIP -iCOMParams:iQuery="Select * From *.txt",iInputParameters="-i:CSV -HeaderRow:Off" -o:DataGrid

LogParser.exe -i:COM "select * From 'Test.tar.gz'" -iProgId:Gluegood.LogParser.ZIP -iCOMParams:iQuery="Select * From *.txt",iInputParameters="-i:CSV -HeaderRow:Off" -o:DataGrid
This additional code now gives capability for:

.zip (always worked with original code)
.tar
.tar.bz2
.tar.gz

One last note is that the original code that gluegood wrote may work for you and I just may have been the unlucky one who had some odd gzipped files...

No comments:

Post a Comment