ddrudik
asked on
Removing multiple lines in a text file based on a date calculation in one of the lines (part 2)
I have a text file with multiple entries formatted as:
Name: x
DOB: mm/dd/yy
Name Number: x
Court Number: x
Race: x
Eyes: x
Height: x
Sex: x
Hair: x
Wgt: x
Issued: x
Expires: x
Process Type: x
Crime Class: x
Wanted for: x
Previously I had asked a question regarding text replacement based on the DOB:
https://www.experts-exchange.com/questions/21611130/Removing-multiple-lines-in-a-text-file-based-on-a-date-calculation-in-one-of-the-lines.html
FernandoSoto answered that question, which I do appreciate his assistance with that. Unfortuantely I am running into a possible complication, I need to have any records where the individual is less than 18 years old on day the report is run to be removed from the text file.
The code works except that where the individual's DOB year is 18 years ago but their DOB month/day is later than today's date, which would technically make that person less than 18 years old, which I need to remove from my text file.
Starting with the code from the previous solution I am looking for the month/day to be included in the DOB check to exclude those records where the individual is less than 18 years old on the day the report is run.
Thanks in advance for your help.
Name: x
DOB: mm/dd/yy
Name Number: x
Court Number: x
Race: x
Eyes: x
Height: x
Sex: x
Hair: x
Wgt: x
Issued: x
Expires: x
Process Type: x
Crime Class: x
Wanted for: x
Previously I had asked a question regarding text replacement based on the DOB:
https://www.experts-exchange.com/questions/21611130/Removing-multiple-lines-in-a-text-file-based-on-a-date-calculation-in-one-of-the-lines.html
FernandoSoto answered that question, which I do appreciate his assistance with that. Unfortuantely I am running into a possible complication, I need to have any records where the individual is less than 18 years old on day the report is run to be removed from the text file.
The code works except that where the individual's DOB year is 18 years ago but their DOB month/day is later than today's date, which would technically make that person less than 18 years old, which I need to remove from my text file.
Starting with the code from the previous solution I am looking for the month/day to be included in the DOB check to exclude those records where the individual is less than 18 years old on the day the report is run.
Thanks in advance for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not a problem, glad I was able to help. ;=)
ASKER