private void ExtractFromFile(string file) { var output = String.Format("{0}.{1}", file, outputExtension); using (var requestor = new ParserRequestor(output, keyword, charset)) { using (var reader = new StreamReader(file, fromCharset == null ? Encoding.Default : Encoding.GetEncoding(fromCharset))) { parser.Parse(reader.ReadToEnd(), requestor); } } if (Notify) { Console.Out.WriteLine("Parsed file {0} and output written to {1}.", file, output); } }