Exporting keys and values from two types of resx files into Excel c#.net -
i'm new c#.net , have created program reads keys , values in specific resx files. have done same different set of corresponding resx files can compare matching keys values (which different or same). have managed write them console in visual studio, export keys , values excel worksheet comparison know need use microsoft.office.interop.excel namespace, dont know how incorporate program in visual studio, since i'm newbie. see code below...
translations.add(new translationentry { key = d.key.tostring(), english = d.value.tostring(), welsh = match.value.tostring() }); if (d.value.tostring() != match.value.tostring()) { console.writeline(d.key.tostring() + " - " + d.value.tostring() + " - " + match.value.tostring()); } else { console.writeline(d.key.tostring() + " - " + d.value.tostring() + " - " + match.value.tostring() + "translation needed"); } } } rsxr_en.close();
and if want work excel here simple example:
using excel = microsoft.office.interop.excel; ... void foo() { excel.application ex = new excel.application(); //first of - run ex.visible = true; //then - show var workbook = ex.workbooks.add(); var sheet = workbook.activesheet; //in order work active sheet sheet.cells[1, 1] = "some value"; //you can access cells row index , column index } so, if want iterate through data in loop - can insert excel using indexes. example:
sheet.cells[i, 1] = d.key.tostring(); sheet.cells[i, 2] = d.value.tostring(); sheet.cells[i, 3] = match.value.tostring(); if (d.value.tostring() == match.value.tostring()) { sheet.cells[i, 4] = "translation needed"; }
Comments
Post a Comment