robert lawton wrote: > I am Currently working on a script that will read > through a list of members in a zip file, if of type > text will read through each byte of data using > "readChunk(1)" appending the data to a string until > the end of line is encountered, Uuon which it will > then do a compare. > The problem arises in locating the end of line and > therefore stop appending to string. The log's are IIS > and MS Proxy type but am trying to code so that any > type of txt file can be searched for a string. > > I understand that the line should end with \n\r or > \x0D \x0A but even searching for previous byte being > of \x0D and current being \x0A results in line not > being located. Have tried \r and \n but it's not > playing ball. > > I don't want to have to extract the log from the zip > before performing the string search as this will use a > great deal of HD space as some of the log's are pretty > big and time taken isn't as much of an issue other > than proving to these people Perl's excellent pattern > matching capabilities. > > I have tried matches on : > /\n$/ > /\r\n$/ > /\n\r$/ > "\x0A" and \previous val being "\x0D" > > Help would be much appreciated. > > Apologies for any HTML here, having to use an external > browser based, free mail provider.
There should be no \r's before your \n's unless you did a binmode on the file after opening. text mode transfers will remove the \r. I would do a binmode to make sure you see all of the data. -- ,-/- __ _ _ $Bill Luebkert ICQ=14439852 (_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED] / ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl) -/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/ _______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin