Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Add 20 before regular expr (year) Expand / Collapse
Author
Message
Posted Friday, May 10, 2013 3:39 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 9:23 AM
Points: 16, Visits: 46
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.
Post #1451490
Posted Friday, May 10, 2013 3:49 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, December 18, 2014 1:43 AM
Points: 6,890, Visits: 14,254
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
Exploring Recursive CTEs by Example Dwain Camps
Post #1451496
Posted Sunday, May 12, 2013 10:04 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 9:23 AM
Points: 16, Visits: 46
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.
Post #1451965
Posted Monday, May 13, 2013 1:11 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, December 18, 2014 1:43 AM
Points: 6,890, Visits: 14,254
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
Exploring Recursive CTEs by Example Dwain Camps
Post #1451988
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse