TheMasterRat
Gawd
- Joined
- Jan 28, 2001
- Messages
- 843
Calling all [H]Coders...
I'm in the middle of a huge project to migrate terabytes of data and need to find a way to parse a log file in the following manner.
Every line of the log file looks like this : (Some information changed)
12/17/2005 00:15:18 - DBG - 00104: FileCopyContentsOverlapped(I:\Shared\DATA\XXX_XX\XXXXXX\XXXXX\v321.ent\XX-XXXXX\dwnlds.xx\xxxxxx\xxxxxxx for P4 Processors\STAGE\Components\xxxxxx.java.javavm.javatools\x.x.x.x.x\x\DataFiles\Expanded\jis\patch\c++\login.tar), Access is denied.
The information I need to get is the path you see within the () and then format it into a copy command of the following nature :
copy \\<server>\ (PATH FROM LOG MINUS I:\SHARED\) (WHOLE PATH FROM LOGFILE)
I'm terrible at parsing log files in scripts. The beginning of the parens is ALWAYS at the same column of the line, but clearly the end will be different depending on the file path.
If anyone has any ideas how to do this or even point me in the right direction, I would be forever in your debt.
This script will need to run on a windows platform.
I'm in the middle of a huge project to migrate terabytes of data and need to find a way to parse a log file in the following manner.
Every line of the log file looks like this : (Some information changed)
12/17/2005 00:15:18 - DBG - 00104: FileCopyContentsOverlapped(I:\Shared\DATA\XXX_XX\XXXXXX\XXXXX\v321.ent\XX-XXXXX\dwnlds.xx\xxxxxx\xxxxxxx for P4 Processors\STAGE\Components\xxxxxx.java.javavm.javatools\x.x.x.x.x\x\DataFiles\Expanded\jis\patch\c++\login.tar), Access is denied.
The information I need to get is the path you see within the () and then format it into a copy command of the following nature :
copy \\<server>\ (PATH FROM LOG MINUS I:\SHARED\) (WHOLE PATH FROM LOGFILE)
I'm terrible at parsing log files in scripts. The beginning of the parens is ALWAYS at the same column of the line, but clearly the end will be different depending on the file path.
If anyone has any ideas how to do this or even point me in the right direction, I would be forever in your debt.
This script will need to run on a windows platform.