Re: string manipulation experts...

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: rusga (reply2newsgroup_at_nntp)
Date: 09/26/04


Date: Sun, 26 Sep 2004 10:31:36 +0100

Cont.

... to make it even faster, you can imediately skip the rightmost 6
characters since it's the minimum (in this case) size of the date portion
resulting in 6 less IFs per file.

This way, I can predict a maximum of 2 loops and respective IFs in a
decremental cicle per log file.

Not bad...
rusga

PS: Smoke a joint, slow down a bit, and change perspective sometimes ;-)

On Sun, 26 Sep 2004 07:43:18 +0100, rusga <reply2newsgroup@nntp> wrote:

> Please...
>
> Traverse the name portion of the string from right to left in 1 char
> units until it's not numeric. stop.
>
> Be happy,
> rusga
>
>
> On Thu, 23 Sep 2004 10:39:58 -0400, Phil Strack <philstrack@hotmail.com>
> wrote:
>
>> Hi-
>> I've inherited a production system that spits out logs that are named
>> <AppName><Date>.log and <AppName>stdError<Date>.log where
>> AppName is the text name of the application
>> Date is in the format YYYYmd
>> and stdError is literal. (examples: application2004923.log,
>> applicationstdError2004923.log)
>> These logs are created by an application that was developed by an
>> outside
>> resource who is no longer available and has become a "black box" to our
>> internal staff. (and of course, no one wants to pony up some money to
>> get
>> some expertise in to make the modification in the application)
>>
>> I've been asked to archive the log files to a different storage
>> location and
>> rename them to a convention more sortable by name. No problems with the
>> archiving piece, but having a problem with the renaming and am seeking
>> suggestions.
>> The new naming convention is AppName-<Date>.log and
>> AppName-<Date>-Err.log
>> where date is in the format: mmddyyyy. (examples:
>> application-09232004.log,
>> application-09232004-Err.log)
>>
>> The problem is this:
>> I am polling the log output folder using the CIM_Datafile class to
>> return a
>> collection of files to archive and I can not figure out how to grab
>> ONLY the
>> date part out of each of the original logs for parsing out and insertion
>> into the new log name.
>> I've tried to count the characters and take the necessary ones out of
>> the
>> string but there are 2 circumstances where that does not work. One when
>> the
>> day is a single character and month is 2 characters and the other is
>> when
>> the day is 2 characters and month is a single character. These two
>> scenarios
>> give the same count character count but I can not account for which date
>> part has one or two characters.
>>
>> Any guidance provided would be greatly appreciated.
>>
>> Thanks
>>
>>
>



Relevant Pages

  • Re: URLScan
    ... You state that "The delimiter of the log file is defined by W3C ... whitespace, not space characters: ...
    (microsoft.public.inetserver.iis.security)
  • More Questions on Relative URLs and Response.Redirect
    ... call would convert all the spaces and special characters into hex so ... they wouldn't interfere with the redirection, but the Log file shows ... DisplayCategory.aspx?category=Jewelry with Other Semi-Precious Stones" ... But my main problem is that, if there is a colon character (which I am ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: cleartext passwords get into log files
    ... the username in some client for connecting to a ssh server. ... the username could contain characters that might be interpreted wrong ... SQL servers or HTML then nothing is ... only print a "UNKNOWN USER" in their log file and in my opinion this ...
    (Bugtraq)
  • Re: Google only spiders the robots.txt
    ... Your log file says that only 25 bytes were transferred. ... > Try counting the characters in your robots.txt file. ... Prev by Date: ...
    (alt.internet.search-engines)
  • Re: ISA Server 2004 Log Manipulation
    ... which when exploited will enable a malicious user to manipulate ... the Destination Host parameter of the log file. ... or record separator characters in the log file)? ...
    (Bugtraq)