private void ReadDumpExample() { string line; System.IO.StreamReader file = new System.IO.StreamReader(@"D:\Wikipedia\Dump\w020n90.tar.gz", Encoding.UTF8); line = file.ReadLine(); // first line is "[" EntitiesDump item = new EntitiesDump(); txtPageList.Text = ""; while ((line = file.ReadLine()) != null) { line = line.Remove(line.Length - 1); string strJson = "{\"entity\":" + line + "}"; //necessary for different structure of json dump try { item = JsonConvert.DeserializeObject<EntitiesDump>(strJson, new DatavalueConverter()); // Do something with item } catch (Exception ex) { MessageBox.Show(ex.Message); } } file.Close(); }
There was an error while loading. Please reload this page.