Easiest way to read Excel files in groovy?

前端 未结 3 907
挽巷
挽巷 2021-02-14 13:42

Are there any warappers/utils available to read Excel files in Groovy. I am looking for something similar to Groovy SQL\'s rows function as shown in below spock test ex

3条回答
  •  时光说笑
    2021-02-14 14:34

    One of my fellow GUG members has created a tool for working with Excel using Apache POI in very much the same way you describe. It's not formalized into a library yet (AFAIK) but is available on his blog.

    It allows you to write code like this:

    new ExcelBuilder("customers.xls").eachLine([labels:true]) {
      new Person(name:"$firstname $lastname",
        address:address, telephone:phone).save()
    }
    

    Check it out here: http://www.technipelago.se/content/technipelago/blog/44

提交回复
热议问题