{"id":178,"date":"2025-08-18T12:55:40","date_gmt":"2025-08-18T12:55:40","guid":{"rendered":"https:\/\/iotnoob.com\/wordpress\/?p=178"},"modified":"2025-08-18T13:10:35","modified_gmt":"2025-08-18T13:10:35","slug":"apache-poi-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a-%e0%b8%ad%e0%b9%88%e0%b8%b2%e0%b8%99%e0%b9%80%e0%b8%82%e0%b8%b5%e0%b8%a2%e0%b8%99%e0%b9%84%e0%b8%9f%e0%b8%a5%e0%b9%8c-xls-xlsx","status":"publish","type":"post","link":"https:\/\/iotnoob.com\/wordpress\/2025\/08\/18\/apache-poi-%e0%b8%aa%e0%b8%b3%e0%b8%ab%e0%b8%a3%e0%b8%b1%e0%b8%9a-%e0%b8%ad%e0%b9%88%e0%b8%b2%e0%b8%99%e0%b9%80%e0%b8%82%e0%b8%b5%e0%b8%a2%e0%b8%99%e0%b9%84%e0%b8%9f%e0%b8%a5%e0%b9%8c-xls-xlsx\/","title":{"rendered":"Apache POI \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a \u0e2d\u0e48\u0e32\u0e19\u0e40\u0e02\u0e35\u0e22\u0e19\u0e44\u0e1f\u0e25\u0e4c XLS, XLSX"},"content":{"rendered":"\n<p>Apache POI \u0e21\u0e35\u0e42\u0e21\u0e14\u0e39\u0e25\u0e41\u0e22\u0e01\u0e01\u0e31\u0e19\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e44\u0e1f\u0e25\u0e4c Excel \u0e41\u0e15\u0e48\u0e25\u0e30\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>XLS (Excel 97-2003):<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>\u0e1f\u0e2d\u0e23\u0e4c\u0e41\u0e21\u0e15:<\/strong> \u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1f\u0e25\u0e4c\u0e41\u0e1a\u0e1a Binary \u0e17\u0e35\u0e48\u0e40\u0e23\u0e35\u0e22\u0e01\u0e27\u0e48\u0e32 <strong>HSSF<\/strong> (Horrible Spreadsheet Format)<\/li>\n\n\n\n<li><strong>\u0e04\u0e25\u0e32\u0e2a\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>HSSFWorkbook<\/code><\/li>\n\n\n\n<li><code>HSSFSheet<\/code><\/li>\n\n\n\n<li><code>HSSFRow<\/code><\/li>\n\n\n\n<li><code>HSSFCell<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>XLSX (Excel 2007 \u0e41\u0e25\u0e30\u0e43\u0e2b\u0e21\u0e48\u0e01\u0e27\u0e48\u0e32):<\/strong>\n<ul class=\"wp-block-list\">\n<li><strong>\u0e1f\u0e2d\u0e23\u0e4c\u0e41\u0e21\u0e15:<\/strong> \u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1f\u0e25\u0e4c\u0e41\u0e1a\u0e1a XML-based \u0e17\u0e35\u0e48\u0e40\u0e23\u0e35\u0e22\u0e01\u0e27\u0e48\u0e32 <strong>XSSF<\/strong> (XML Spreadsheet Format) \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e2a\u0e48\u0e27\u0e19\u0e2b\u0e19\u0e36\u0e48\u0e07\u0e02\u0e2d\u0e07\u0e21\u0e32\u0e15\u0e23\u0e10\u0e32\u0e19 Office Open XML<\/li>\n\n\n\n<li><strong>\u0e04\u0e25\u0e32\u0e2a\u0e2b\u0e25\u0e31\u0e01\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>XSSFWorkbook<\/code><\/li>\n\n\n\n<li><code>XSSFSheet<\/code><\/li>\n\n\n\n<li><code>XSSFRow<\/code><\/li>\n\n\n\n<li><code>XSSFCell<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>\u0e17\u0e35\u0e19\u0e35\u0e49\u0e16\u0e49\u0e32\u0e40\u0e23\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23 support \u0e44\u0e1f\u0e25\u0e4c\u0e17\u0e31\u0e49\u0e07 2 \u0e0a\u0e19\u0e34\u0e14 \u0e40\u0e1e\u0e23\u0e32\u0e30 \u0e40\u0e23\u0e32\u0e44\u0e21\u0e48\u0e23\u0e39\u0e49\u0e27\u0e48\u0e32 user \u0e08\u0e30\u0e44\u0e14\u0e49\u0e44\u0e1f\u0e25\u0e4c\u0e41\u0e1a\u0e1a\u0e44\u0e2b\u0e19\u0e21\u0e32 \u0e41\u0e15\u0e48\u0e16\u0e49\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e21\u0e32\u0e19\u0e31\u0e48\u0e07\u0e40\u0e02\u0e35\u0e22\u0e19\u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a\u0e17\u0e31\u0e49\u0e07 2 \u0e41\u0e1a\u0e1a\u0e01\u0e47\u0e01\u0e23\u0e30\u0e44\u0e23\u0e2d\u0e22\u0e39\u0e48 \u0e0b\u0e36\u0e48\u0e07 Apache POI \u0e01\u0e47\u0e21\u0e35 Class WorkbookFactory \u0e21\u0e32\u0e43\u0e2b\u0e49\u0e41\u0e25\u0e49\u0e27 &#8211; \u0e40\u0e1e\u0e34\u0e48\u0e07\u0e08\u0e30\u0e23\u0e39\u0e49<\/p>\n\n\n\n<p><strong>\u0e2b\u0e25\u0e31\u0e01\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>WorkbookFactory<\/code><\/strong> \u0e40\u0e1b\u0e47\u0e19\u0e04\u0e25\u0e32\u0e2a\u0e2d\u0e23\u0e23\u0e16\u0e1b\u0e23\u0e30\u0e42\u0e22\u0e0a\u0e19\u0e4c\u0e17\u0e35\u0e48\u0e08\u0e30\u0e15\u0e23\u0e27\u0e08\u0e2a\u0e2d\u0e1a\u0e40\u0e19\u0e37\u0e49\u0e2d\u0e2b\u0e32\u0e02\u0e2d\u0e07\u0e44\u0e1f\u0e25\u0e4c (\u0e44\u0e21\u0e48\u0e43\u0e0a\u0e48\u0e41\u0e04\u0e48\u0e19\u0e32\u0e21\u0e2a\u0e01\u0e38\u0e25) \u0e41\u0e25\u0e49\u0e27\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e2d\u0e47\u0e2d\u0e1a\u0e40\u0e08\u0e01\u0e15\u0e4c\u0e02\u0e2d\u0e07\u0e04\u0e25\u0e32\u0e2a\u0e17\u0e35\u0e48\u0e40\u0e2b\u0e21\u0e32\u0e30\u0e2a\u0e21 (<code>HSSFWorkbook<\/code> \u0e2b\u0e23\u0e37\u0e2d <code>XSSFWorkbook<\/code>) \u0e43\u0e2b\u0e49\u0e40\u0e23\u0e32\u0e42\u0e14\u0e22\u0e2d\u0e31\u0e15\u0e42\u0e19\u0e21\u0e31\u0e15\u0e34<\/li>\n\n\n\n<li>\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01 <code>WorkbookFactory.create()<\/code> \u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e2d\u0e47\u0e2d\u0e1a\u0e40\u0e08\u0e01\u0e15\u0e4c\u0e0a\u0e19\u0e34\u0e14 <strong><code>Workbook<\/code><\/strong> \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e1b\u0e47\u0e19 Interface \u0e01\u0e25\u0e32\u0e07<\/li>\n\n\n\n<li>\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19 \u0e40\u0e23\u0e32\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e04\u0e49\u0e14\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e27\u0e19\u0e25\u0e39\u0e1b\u0e2d\u0e48\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49 Interface <code>Sheet<\/code>, <code>Row<\/code>, <code>Cell<\/code> \u0e44\u0e14\u0e49\u0e40\u0e25\u0e22 \u0e0b\u0e36\u0e48\u0e07\u0e42\u0e04\u0e49\u0e14\u0e2a\u0e48\u0e27\u0e19\u0e19\u0e35\u0e49\u0e08\u0e30\u0e17\u0e33\u0e07\u0e32\u0e19\u0e44\u0e14\u0e49\u0e01\u0e31\u0e1a\u0e44\u0e1f\u0e25\u0e4c\u0e17\u0e31\u0e49\u0e07\u0e2a\u0e2d\u0e07\u0e0a\u0e19\u0e34\u0e14\u0e42\u0e14\u0e22\u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e41\u0e1b\u0e25\u0e07\u0e2d\u0e30\u0e44\u0e23<\/li>\n<\/ul>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import org.apache.poi.ss.usermodel.*;\nimport java.io.File;\nimport java.io.FileInputStream;\nimport java.io.IOException;\n\npublic class UniversalExcelReader {\n\n    public void readExcelFile(String filePath) {\n        try (FileInputStream fis = new FileInputStream(new File(filePath));\n             \/\/ 1. \u0e43\u0e0a\u0e49 WorkbookFactory \u0e2a\u0e23\u0e49\u0e32\u0e07 Workbook \u0e08\u0e32\u0e01\u0e44\u0e1f\u0e25\u0e4c\n             \/\/ \u0e44\u0e21\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e2a\u0e19\u0e43\u0e08\u0e27\u0e48\u0e32\u0e40\u0e1b\u0e47\u0e19 XLS \u0e2b\u0e23\u0e37\u0e2d XLSX, Factory \u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e43\u0e2b\u0e49\n             Workbook workbook = WorkbookFactory.create(fis)) {\n\n            \/\/ 2. \u0e14\u0e36\u0e07 Sheet \u0e41\u0e23\u0e01\u0e2d\u0e2d\u0e01\u0e21\u0e32 (\u0e40\u0e23\u0e32\u0e44\u0e14\u0e49\u0e2d\u0e47\u0e2d\u0e1a\u0e40\u0e08\u0e01\u0e15\u0e4c\u0e40\u0e1b\u0e47\u0e19 Interface 'Sheet')\n            Sheet sheet = workbook.getSheetAt(0);\n\n            \/\/ 3. \u0e27\u0e19\u0e25\u0e39\u0e1b\u0e2d\u0e48\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49 Interface 'Row' \u0e41\u0e25\u0e30 'Cell'\n            \/\/ \u0e42\u0e04\u0e49\u0e14\u0e2a\u0e48\u0e27\u0e19\u0e19\u0e35\u0e49\u0e40\u0e2b\u0e21\u0e37\u0e2d\u0e19\u0e01\u0e31\u0e19\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14 \u0e44\u0e21\u0e48\u0e27\u0e48\u0e32\u0e15\u0e49\u0e19\u0e17\u0e32\u0e07\u0e08\u0e30\u0e40\u0e1b\u0e47\u0e19\u0e44\u0e1f\u0e25\u0e4c\u0e0a\u0e19\u0e34\u0e14\u0e43\u0e14\n            for (Row row : sheet) {\n                for (Cell cell : row) {\n                    \/\/ \u0e1e\u0e34\u0e21\u0e1e\u0e4c\u0e04\u0e48\u0e32\u0e43\u0e19 Cell \u0e2d\u0e2d\u0e01\u0e21\u0e32 \u0e42\u0e14\u0e22\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e15\u0e32\u0e21\u0e1b\u0e23\u0e30\u0e40\u0e20\u0e17\u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\n                    printCellValue(cell);\n                }\n                System.out.println(); \/\/ \u0e02\u0e36\u0e49\u0e19\u0e1a\u0e23\u0e23\u0e17\u0e31\u0e14\u0e43\u0e2b\u0e21\u0e48\u0e40\u0e21\u0e37\u0e48\u0e2d\u0e08\u0e1a\u0e41\u0e16\u0e27\n            }\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n    }\n\n    private void printCellValue(Cell cell) {\n        switch (cell.getCellType()) {\n            case STRING:\n                System.out.print(cell.getStringCellValue() + \"\\t\");\n                break;\n            case NUMERIC:\n                if (DateUtil.isCellDateFormatted(cell)) {\n                    System.out.print(cell.getDateCellValue() + \"\\t\");\n                } else {\n                    System.out.print(cell.getNumericCellValue() + \"\\t\");\n                }\n                break;\n            case BOOLEAN:\n                System.out.print(cell.getBooleanCellValue() + \"\\t\");\n                break;\n            case FORMULA:\n                System.out.print(cell.getCellFormula() + \"\\t\");\n                break;\n            case BLANK:\n                System.out.print(\"[BLANK]\\t\");\n                break;\n            default:\n                System.out.print(\"[UNKNOWN]\\t\");\n        }\n    }\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;dependencies>\n    &lt;dependency>\n        &lt;groupId>org.apache.poi&lt;\/groupId>\n        &lt;artifactId>poi&lt;\/artifactId>\n        &lt;version>5.2.5&lt;\/version> &lt;\/dependency>\n    &lt;dependency>\n        &lt;groupId>org.apache.poi&lt;\/groupId>\n        &lt;artifactId>poi-ooxml&lt;\/artifactId>\n        &lt;version>5.2.5&lt;\/version> &lt;\/dependency>\n&lt;\/dependencies><\/pre>\n\n\n\n<p>\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23 \u0e41\u0e1b\u0e25\u0e07 \u0e04\u0e48\u0e32 column name (A, B, C, &#8230;) \u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e47\u0e19 index (1, 2, 3, &#8230;)<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import org.apache.poi.ss.util.CellReference;\n\npublic class ExcelColumnConverter {\n    public static void main(String[] args) {\n        String columnLetter1 = \"A\";\n        String columnLetter2 = \"Z\";\n        String columnLetter3 = \"AA\";\n        String columnLetter4 = \"AZ\";\n\n        \/\/ \u0e41\u0e1b\u0e25\u0e07 \"AA\" (\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c\u0e17\u0e35\u0e48 27)\n        int zeroBasedIndex = CellReference.convertColStringToIndex(columnLetter3); \/\/ \u0e08\u0e30\u0e44\u0e14\u0e49 26\n        int oneBasedIndex = zeroBasedIndex + 1;                                  \/\/ \u0e1a\u0e27\u0e01 1 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e43\u0e2b\u0e49\u0e44\u0e14\u0e49 27\n\n        System.out.println(\"'\" + columnLetter1 + \"' \u0e04\u0e37\u0e2d\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c\u0e17\u0e35\u0e48 \" + (CellReference.convertColStringToIndex(columnLetter1) + 1));\n        System.out.println(\"'\" + columnLetter2 + \"' \u0e04\u0e37\u0e2d\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c\u0e17\u0e35\u0e48 \" + (CellReference.convertColStringToIndex(columnLetter2) + 1));\n        System.out.println(\"'\" + columnLetter3 + \"' \u0e04\u0e37\u0e2d\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c\u0e17\u0e35\u0e48 \" + oneBasedIndex);\n        System.out.println(\"'\" + columnLetter4 + \"' \u0e04\u0e37\u0e2d\u0e04\u0e2d\u0e25\u0e31\u0e21\u0e19\u0e4c\u0e17\u0e35\u0e48 \" + (CellReference.convertColStringToIndex(columnLetter4) + 1));\n    }\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Apache POI \u0e21\u0e35\u0e42\u0e21\u0e14\u0e39\u0e25\u0e41\u0e22\u0e01\u0e01\u0e31\u0e19\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e08\u0e31\u0e14\u0e01\u0e32\u0e23\u0e44\u0e1f\u0e25\u0e4c Excel \u0e41\u0e15\u0e48\u0e25\u0e30\u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19: \u0e17\u0e35\u0e19\u0e35\u0e49\u0e16\u0e49\u0e32\u0e40\u0e23\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23 support \u0e44\u0e1f\u0e25\u0e4c\u0e17\u0e31\u0e49\u0e07 2 \u0e0a\u0e19\u0e34\u0e14 \u0e40\u0e1e\u0e23\u0e32\u0e30 \u0e40\u0e23\u0e32\u0e44\u0e21\u0e48\u0e23\u0e39\u0e49\u0e27\u0e48\u0e32 user \u0e08\u0e30\u0e44\u0e14\u0e49\u0e44\u0e1f\u0e25\u0e4c\u0e41\u0e1a\u0e1a\u0e44\u0e2b\u0e19\u0e21\u0e32 \u0e41\u0e15\u0e48\u0e16\u0e49\u0e32\u0e15\u0e49\u0e2d\u0e07\u0e21\u0e32\u0e19\u0e31\u0e48\u0e07\u0e40\u0e02\u0e35\u0e22\u0e19\u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a\u0e17\u0e31\u0e49\u0e07&hellip;<\/p>\n","protected":false},"author":1,"featured_media":183,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,2],"tags":[],"class_list":["post-178","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-programming"],"_links":{"self":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts\/178","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/comments?post=178"}],"version-history":[{"count":2,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts\/178\/revisions"}],"predecessor-version":[{"id":180,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/posts\/178\/revisions\/180"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/media\/183"}],"wp:attachment":[{"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/media?parent=178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/categories?post=178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotnoob.com\/wordpress\/wp-json\/wp\/v2\/tags?post=178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}