开发者

Edit a .gziped log text file in C#

I receive logs which are .gz (zipped) and contain text files.

One field in开发者_高级运维 the logs needs to be edited, present on every row, to contain some other data then what is currently present in the logs.

My thinking so far is to:

  1. Unzip file
  2. Read it
  3. Edit it
  4. Write it
  5. Rezip it

But I guess there is a better way to do this, is there any on-the-fly reading/editing from .gz log files available in C#?

Thanks!


Unless you want to work at the bit-level, the method you suggest is the correct approach.

incase you are unfamiliar with the .Net libraries for this, here is a code project article.

http://www.codeproject.com/KB/files/GZipStream.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜