added support for printing output. and windows port

Use the the first command argument to pass the filename.
the output also has a timestamp