import java.io.*;
import java.util.*;
/******************************************************************
* 
* 
*
* @author - Andrew Kelley
* @version - V1 - 01/22/07
*******************************************************************/
//Andrew Kelley
//01/22/07
//Lab 4
//MW 2:30
public class IO_kelle2ja_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);

       screen.printf(Locale.US, "\nToday's Date: %1$te %1$tB %1$tY\n", today);
       screen.flush();       
		
		 //test file making sure its found
		 try
		 {
		 	//for multiple files, runs through each and then sends them to processDates
		 	for(int i = 0; i < args.length; i ++)
			{
		    dates    = new File(args[i]);
          dateScanner = new Scanner(dates);
			 processDates(today);
			}
		 }
		 catch(FileNotFoundException fnfe)
		 {
		 	System.out.println("File that was pass not found.");
		 }

       
    }
    


    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();
          }
       }
    }
    

}
