Add 20 before regular expr (year)

  • Hi All,

    I am getting input file below format.

    Text-dd.mm.yy.

    i need to display as 20yy (year) and mm.dd (Issue) For that i am using regular expr. i am using

    '^Text-(?<Issue>\d{2}\.\d{2}).(?<Year>\d{2})\.txt$'

    output is yy and dd.mm

    i need to add 20 before yy i.e. output will be 20yy.

    Please give your suggestion. Thanks in advance.

  • rohit.kumar.barik (5/10/2013)


    Hi All,

    I am getting input file below format.

    Text-dd.mm.yy.

    i need to display as 20yy (year) and mm.dd (Issue) For that i am using regular expr. i am using

    '^Text-(?<Issue>\d{2}\.\d{2}).(?<Year>\d{2})\.txt$'

    output is yy and dd.mm

    i need to add 20 before yy i.e. output will be 20yy.

    Please give your suggestion. Thanks in advance.

    Can you show a few rows of sample data please?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • I am getting file like Text-23.05.13 [dd.mm.yy]

    out put should be : 2013 and 23.05

    For that i used regular expr: (?<Issue>\d{2}\.\d{2}).(?<Year>\d{2})

    The 20 value is not coming before 13. i need this.

    Please suggest.

  • rohit.kumar.barik (5/12/2013)


    I am getting file like Text-23.05.13 [dd.mm.yy]

    out put should be : 2013 and 23.05

    For that i used regular expr: (?<Issue>\d{2}\.\d{2}).(?<Year>\d{2})

    The 20 value is not coming before 13. i need this.

    Please suggest.

    We need to know exactly what your data looks like and it's not yet clear from your posts. Please have a look at the link in my sig "please read this" to see how to post sample data. I'm sure this isn't as tricky as it might appear.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply