Link to home
Start Free TrialLog in
Avatar of celtician
celticianFlag for American Samoa

asked on

Compare if date string is within text file

I need a unix function that given certain date i.e. in DDMMYYY format "05082016", it will return wether that date is within certain text file (with a list of dates, national holidays actually) or not.

My text file, holidays.txt has only the next content

10122016
05012016
31042016
17062016

when i call the function i need to write, isHoliday(DDMMYYY) it will return a 1  if the date is within the previous list or a 0 if its not.

how should i implement it?
ASKER CERTIFIED SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of celtician

ASKER

Good answers, it worked.