//We used the input/output and the java util class. 

import java.io.*;
import java.util.*;

/***************************
 * @author: Stephen Hack
 * @version Lab 4 - Experimenting with I/O
	CS 239
	January 22, 2006
	Section 3. Dr. Harris. 
	I have not given nor recieved any unauthorized help.
*****************************/



public class IO_hacksd_Remember
{
    private static Scanner        dateScanner;
    private static PrintWriter    screen;
    


    public static void main(String[] args)
    {
       GregorianCalendar        today;
       String                   name;       
		
		File 				dates;
       
       today    = new GregorianCalendar();
       screen   = new PrintWriter(System.out);
		 
		 dates = new File(args[0]); //uses the File Class. 

       screen.printf(Locale.US, "\nToday's Date: %1$te %1$tB %1$tY\n", today);
       screen.flush();       

       try 
		 	{
		 	dateScanner = new Scanner(dates);
		 	}
		 	
				catch (FileNotFoundException fnfe) 
				{
				System.out.println("File not found.");
				}
		
       processDates(today);
    }
    


    private static void processDates(GregorianCalendar today)
    {
       int           day, month;              
       String        name;
       

       // Use the '\t' (tab) and '/' characters as delimiters
       dateScanner.useDelimiter("[\t/]");
          
          
       while (dateScanner.hasNext())
       {
          month = dateScanner.nextInt();
          day   = dateScanner.nextInt();
          name  = dateScanner.nextLine();

          if ((month == (today.get(Calendar.MONTH)+1)) && 
              (day   == today.get(Calendar.DAY_OF_MONTH)))
          {
             screen.printf("%s\n", name);
             screen.flush();
          }
       }
    }
    

}
