Scratch
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.StringTokenizer;

public class FindMissingPunches
{
    public static void main(String[] args)
    {
        try
        {
            BufferedReader reader = new BufferedReader(new FileReader(args[0]));
            String s = "";

            /* build a HTML buffer */
            StringBuffer buffer = new StringBuffer();
            buffer.append("<html>" + " <head> </head>" + "<body>");
            String  previousPunchIDStr = "INITIAL";
            Integer previousPunchID = 0;

            buffer.append("<table border = \"1\">");
            while ((s = reader.readLine()) != null)
            {
                StringTokenizer st = new StringTokenizer(s, ",");

                String punchID = st.nextToken();
                String oPunchID = punchID;
                /* convert the punch id to a number */
                //System.out.println("Current PunchID = " + punchID);
                punchID = punchID.trim();
                if (!punchID.equals("MINP"))
                {

                    try 
                    {
                        /* convert */
                        punchID = punchID.substring(2);
                        Integer currentPunchID = new Integer(punchID);

                        /* all good for now no errors while converting */

                        if (previousPunchIDStr.equals("INITIAL"))
                        {
                            previousPunchIDStr = punchID;
                        }
                        else
                        {
                            previousPunchID = new Integer(previousPunchIDStr);

                            /* so far so good */
                            if (previousPunchID + 1 != currentPunchID)
                            {
                                buffer.append("<tr><td colspan=\"4\" bgcolor = \"yellow\">" + (previousPunchID + 1) + "</td></tr>");
                            }

                            previousPunchIDStr = punchID;
                        }

                        buffer.append("<tr>");

                        buffer.append("<td>" +  oPunchID + "</td>");
                        //buffer.append("<td>" + st.nextToken() + "</td>");
                        //buffer.append("<td>" + st.nextToken() + "</td>");
                        //buffer.append("<td>" + st.nextToken() + "</td>");
                        buffer.append("</tr>");

                    } catch (NumberFormatException nfe)
                    {

                    }
                }

            }
            buffer.append("</table></body></html>");
            System.out.println(buffer.toString());
        } catch (Exception e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

http://blogs.msdn.com/b/askie/archive/2009/06/19/how-to-bypass-the-security-warning-unknown-publisher-with-the-checkbox-always-ask-before-opening-this-file.aspx

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License