red_0220
New member
- Joined
- Sep 14, 2023
- Messages
- 3
- Programming Experience
- 1-3
Hello;
In an Excel file containing Japanese Kanji with phonetic, how can I get the phonetic above the Japanese Kanji?
Here is a simple code Excel string extraction program, but it cannot capture the above Katakana.
The code to get string from excel, but it cannot get the above Katakana.
In an Excel file containing Japanese Kanji with phonetic, how can I get the phonetic above the Japanese Kanji?
Here is a simple code Excel string extraction program, but it cannot capture the above Katakana.
The code to get string from excel, but it cannot get the above Katakana.
Get Excel String:
string excelFilePath = Directorypath + "TestBook.xlsx";
Excel.Application excelApp = new Excel.Application();
Excel.Workbook workbook = excelApp.Workbooks.Open(excelFilePath);
Excel.Worksheet worksheet = (Excel.Worksheet)workbook.Worksheets.get_Item(1);
int rowCount = worksheet.UsedRange.Rows.Count;
int colCount = worksheet.UsedRange.Columns.Count;
for (int row = 1; row <= rowCount; row++)
{
for (int col = 1; col <= colCount; col++)
{
Excel.Range cell = worksheet.Cells[row, col];
string cellValue = cell.Value != null ? cell.Value.ToString() : "";
Console.Write(cellValue + "\t");
}
Console.WriteLine();
}
workbook.Close();
excelApp.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(worksheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(workbook);
System.Runtime.InteropServices.Marshal.ReleaseComObject(excelApp);