Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Add 20 before regular expr (year)


Add 20 before regular expr (year)

Author
Message
rohit.kumar.barik
rohit.kumar.barik
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 49
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.
ChrisM@Work
ChrisM@Work
SSCrazy Eights
SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)

Group: General Forum Members
Points: 8975 Visits: 19028
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
rohit.kumar.barik
rohit.kumar.barik
Grasshopper
Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)Grasshopper (16 reputation)

Group: General Forum Members
Points: 16 Visits: 49
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.
ChrisM@Work
ChrisM@Work
SSCrazy Eights
SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)

Group: General Forum Members
Points: 8975 Visits: 19028
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search