Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Help - Deleting a log line with a data older than 14 days

by rrwo (Friar)
on Dec 10, 2004 at 20:16 UTC ( [id://413972]=note: print w/replies, xml ) Need Help??


in reply to Help - Deleting a log line with a data older than 14 days

That doesn't look like a CSV to me. Where are the commas?

Also: any reason that you're not doing in directly on the Windows NT box? Perl runs quite well on NT/2000/2003, and when I used to maintain several NT servers for a living, most of my admin scripts were in Perl.

  • Comment on Re: Help - Deleting a log line with a data older than 14 days

Replies are listed 'Best First'.
Re^2: Help - Deleting a log line with a data older than 14 days
by Roshan_2004 (Initiate) on Dec 12, 2004 at 21:42 UTC
    Thanks Gods,

    Thank you soo much for taking the time to answer my question, Really good of you.

    Ok here is a bit from the CSV file, Yeah I could run it on the NT box, but the jobs has to be trigged from the Unix cron job. so I was thinking it might be better to do the whole thing on the unix box. But it would be ok to run it on the NT box as well..

    I just want to get the code down fist to process the file and then worry about that later. Yes I will need to read the data from the main file and save to another temp file then rename this to the original. File locking won’t be that much of a problem if I ran it about 2.30AM.

    Thanks for all the advice. I just started and didn’t thinking it would be this complicated. I was just going to use the cut,awk, etc.

    Any code to start me off or sample code of similar task would be appreciated.

    Can any one give me the some code direction as to how to process the line to check for that date and then remove the line and save to a file,etc. I realy thought I could use use CUT, grep,etc.

    0000063547,VPNT,O,25112004,00:07:48,Boom Gate Exit
    0000063547,VPNT,I,25112004,02:32:28,Boom Gate Entry
    0000070200,VPNT,I,25112004,05:45:33,TS 1 Entry
    0000066665,VPNT,I,25112004,05:47:49,VSG 1 Entry
    0000056910,VPNT,I,25112004,05:48:20,VSG 1 Entry
    0000073066,VPNT,I,25112004,05:52:26,TS 1 Entry
    0000069267,VPNT,I,25112004,05:59:17,TS 1 Entry
    0000070696,VPNT,I,25112004,06:04:16,Boom Gate Entry
    0000064635,VPNT,I,25112004,06:10:17,Boom Gate Entry
    0000068224,VPNT,I,25112004,06:10:46,TS 8A Entry
    0000067360,VPNT,I,25112004,06:15:10,TS 8B Entry
    0000069604,VPNT,I,25112004,06:15:19,VSG 1 Entry
    0000075836,VPNT,I,25112004,06:17:44,TS 8B Entry
    0000064645,VPNT,I,25112004,06:23:32,VSG 1 Entry
    0000073744,VPNT,I,25112004,06:23:38,TS 8A Entry
    0000067516,VPNT,I,25112004,06:23:52,TS 1 Entry

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://413972]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2025-01-18 13:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (56 votes). Check out past polls.