Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replace date with currnt date-15 days dynamically in multiple files prsnt in folder

Status
Not open for further replies.

shankar455

Programmer
May 2, 2019
2
0
0
US
I am completely newbee to Vb scripting .Kindly help me with the requirement where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with current date minus 15 days

file content
RTG*888*TD8*20180201~
TWW*888*RD8*20180201-20180201~
RTG*888*TD8*20180201-20180201~
KCG*888*TD8*20180201-20180201~
I want the output as below by changing date. Please help. I am looking for VB script to make it work for all files present in that directory

RTG*888*TD8*20190417~
TWW*888*RD8*20180201-20180201~
RTG*888*TD8*20190417-20190417~
KCG*888*TD8*20180201-20180201~
 
Have you read the file in and separated the fields? Show us what you have done so far. We can help you with your coding problems but we are not a code writing service.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top