Re: string manipulation experts...
From: Thorsten Helfer (thorsten.helfer_at_it-helfer.de)
Date: 09/23/04
- Next message: ganesh: "Re: string manipulation experts..."
- Previous message: Lee Peedin: "Re: Parsing a text file"
- In reply to: Phil Strack: "string manipulation experts..."
- Next in thread: Phil Strack: "Re: string manipulation experts..."
- Reply: Phil Strack: "Re: string manipulation experts..."
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 23 Sep 2004 17:08:27 +0200
Hi Phil,
Just a question before I am going to write down a code snippet.
Is the file creation date (timestamp), the same like the date in the
filename?
In that case you can use this information to create your new file name.
Greetings from Germany,
Thorsten
"Phil Strack" <philstrack@hotmail.com> schrieb im Newsbeitrag
news:%23Rml0sXoEHA.3876@TK2MSFTNGP15.phx.gbl...
> 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
>
>
- Next message: ganesh: "Re: string manipulation experts..."
- Previous message: Lee Peedin: "Re: Parsing a text file"
- In reply to: Phil Strack: "string manipulation experts..."
- Next in thread: Phil Strack: "Re: string manipulation experts..."
- Reply: Phil Strack: "Re: string manipulation experts..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|