{"id":1813,"date":"2020-01-21T14:08:07","date_gmt":"2020-01-21T07:08:07","guid":{"rendered":"https:\/\/www.lixionary.com\/?p=1813"},"modified":"2020-01-21T14:08:07","modified_gmt":"2020-01-21T07:08:07","slug":"parse-excel-with-kotlin","status":"publish","type":"post","link":"https:\/\/lixionary.com\/index.php\/2020\/01\/21\/parse-excel-with-kotlin\/","title":{"rendered":"Parse Excel with Kotlin"},"content":{"rendered":"\n<p>I want to share how to parse excel files using kotlin and apache poi java lib. repository can be found <a href=\"http:\/\/git clone https:\/\/Felixsu@bitbucket.org\/Felixsu\/excel-parser.git\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"here (opens in a new tab)\">here<\/a>.<\/p>\n\n\n\n<p>This example will parse a sheet with several cell type (number, string, date).  The basic ideas are:<br>1. get the Workbook instance by instantiating XSSFWorkbook(file: File)<br>2. get the Sheet instance by call workbook.getSheetAt(idx: Int) or workbook.getSheet(sheetName: String)<br>3. traverse every rows in the sheet by call sheet.getRow(idx: Int)<br>4. traverse every columns in the row.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"706\" height=\"236\" src=\"https:\/\/lixionary.com\/wp-content\/uploads\/2020\/01\/cb23c-image_21-1-20_at_1.23_pm.jpg\" alt=\"\" class=\"wp-image-1814\" srcset=\"https:\/\/lixionary.com\/wp-content\/uploads\/2020\/01\/cb23c-image_21-1-20_at_1.23_pm.jpg 706w, https:\/\/lixionary.com\/wp-content\/uploads\/2020\/01\/cb23c-image_21-1-20_at_1.23_pm-300x100.jpg 300w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>I want to share how to parse excel files using kotlin and apache poi java lib. repository can be found here. This example will parse a sheet with several cell type (number, string, date). The basic ideas are:1. get the Workbook instance by instantiating XSSFWorkbook(file: File)2. get the Sheet instance by call workbook.getSheetAt(idx: Int) or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[9,7],"tags":[44,150,228,244,494],"class_list":["post-1813","post","type-post","status-publish","format-standard","hentry","category-knowledge","category-story","tag-apache","tag-excel","tag-java","tag-kotlin","tag-tutorial"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"lixsu92","author_link":"https:\/\/lixionary.com\/index.php\/author\/lixsu92\/"},"uagb_comment_info":1,"uagb_excerpt":"I want to share how to parse excel files using kotlin and apache poi java lib. repository can be found here. This example will parse a sheet with several cell type (number, string, date). The basic ideas are:1. get the Workbook instance by instantiating XSSFWorkbook(file: File)2. get the Sheet instance by call workbook.getSheetAt(idx: Int) or&hellip;","_links":{"self":[{"href":"https:\/\/lixionary.com\/index.php\/wp-json\/wp\/v2\/posts\/1813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lixionary.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lixionary.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lixionary.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lixionary.com\/index.php\/wp-json\/wp\/v2\/comments?post=1813"}],"version-history":[{"count":0,"href":"https:\/\/lixionary.com\/index.php\/wp-json\/wp\/v2\/posts\/1813\/revisions"}],"wp:attachment":[{"href":"https:\/\/lixionary.com\/index.php\/wp-json\/wp\/v2\/media?parent=1813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lixionary.com\/index.php\/wp-json\/wp\/v2\/categories?post=1813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lixionary.com\/index.php\/wp-json\/wp\/v2\/tags?post=1813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}