Perl question.. i dont know if this is the right place

Discussion in 'Computer Support' started by sibijohn, Aug 7, 2006.

  1. sibijohn

    sibijohn Guest

    I have a file name result01182006.xml which is named according to the
    date. I know how to split it to get the values

    $a = "result01182006.xml";
    $a =~ /^(result)(\d{2})(\d{2})(\d{4})/;
    print "$1 $2 $3 $4\n";

    In the contents of this file i I need to replace every instance of
    1/7/2006 to 01/18/2006.

    Change the date of "Sat 07 Jan 2006" to corresponding day which
    01/18/2006 falls on, so it should be changed to "Wed 18 Jan 2006

    and change the string result01072006 to result01182006

    Please can somebody help here.. Working on no sleep whatsover in 24
    hrs.

    Sibi
     
    sibijohn, Aug 7, 2006
    #1
    1. Advertisements

  2. sibijohn

    usenet Guest

    usenet, Aug 8, 2006
    #2
    1. Advertisements

  3. sibijohn

    Rod Speed Guest

    Wrong.

    There is never ever anything universal about usenet.
    How odd that so many multiposts get replys.
     
    Rod Speed, Aug 8, 2006
    #3
  4. sibijohn

    why? Guest

    On 7 Aug 2006 15:48:02 -0700, wrote:

    There are Perl newsgroups, FAQs, loads of website and mailing lists.

    Lots of Perl examples from the above sources deal with regex and dates.
    It's assumed this is an example and you have to change any occurance of
    date A to date B and not only 1/7/2006 to 01/18/2006?

    Because if it'a single date A to B everywhere and there is no A to C , D
    to E swaps then you don't have to do anything beyond a simple replace.
    Same goes for Sat 07 Jan 2006 to Wed 19 Jan 2006 it's a simple string
    replace and you don't need to look up the Sat to Wed conversion.
    So is what is your problem -

    Modifying files?

    The algorithm to lookup / replace text?

    A calendar module you can lookup the translation for Sat to Wed?
    Me
     
    why?, Aug 8, 2006
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.