Solved

Find / Replace Dates

Posted on 2008-10-14
1
208 Views
Last Modified: 2012-05-05
I am writing a program that opens and reads all the files in a directory one at a time and if any occurences of the following are found, then the month is incremented by +1. also, if the current year is other than 2008, replace with current year.
'20080301'
'2008-08-18
'200808%'
'2008-08-01'
'200808
I've tried the System.Text.RegularExpressions and the replace() methods, but wanted to know if someone had a better approach.

Thanks in advance
pandkyon
0
Comment
Question by:pandkyon
1 Comment
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 300 total points
ID: 22718880
I think you are already using a good method. The regular expression is the answer to matching multiple words to a pattern. And the replace function would obviously do the actual replacing of the word for you.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now