{"id":33,"date":"2022-01-27T16:24:43","date_gmt":"2022-01-27T08:24:43","guid":{"rendered":"https:\/\/blog.zjia.me\/?p=33"},"modified":"2026-06-19T21:15:31","modified_gmt":"2026-06-19T13:15:31","slug":"excel%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"https:\/\/blog.ttwow.top\/?p=33","title":{"rendered":"excel\u89e3\u6790\u5b57\u6bb5"},"content":{"rendered":"<pre><code class=\"language-java\">public String getCellValue(Cell cell) {\n        String value = &quot;&quot;;\n        SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyy-MM-dd&quot;);\n        if (cell != null){\n            switch (cell.getCellTypeEnum()) {\n                case STRING:\n                    value = cell.getRichStringCellValue().getString();\n                    break;\n                case NUMERIC:\n                    String debug_str = cell.getCellStyle().getDataFormatString();\n\n                    if (&quot;m\/d\/yy&quot;.equals(cell.getCellStyle().getDataFormatString()) || &quot;yyyy\\\\-mm\\\\-dd&quot;.equals(cell.getCellStyle().getDataFormatString())) {\n                        value = sdf.format(cell.getDateCellValue());\n                    } else {\n                        DecimalFormat df = new DecimalFormat(&quot;#&quot;);\n                        value = df.format(cell.getNumericCellValue());\n\/\/                    value = String.valueOf(cell.getNumericCellValue());\n                    }\n                    break;\n                case BOOLEAN:\n                    value = String.valueOf(cell.getBooleanCellValue());\n                    break;\n                default:\n                    break;\n            }\n        }\n        return RegexUtils.trimSpaceTag(value);\n    }<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>public String getCellValue(Cell cell) { String value =  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[135],"tags":[164],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-code-snippets","tag-excel"],"_links":{"self":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33"}],"version-history":[{"count":1,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":2070,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions\/2070"}],"wp:attachment":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}