Skip to content

Commit 8091332

Browse files
committed
Tweak README.md
1 parent fdc3475 commit 8091332

1 file changed

Lines changed: 56 additions & 10 deletions

File tree

README.md

Lines changed: 56 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,67 @@
1-
## GExcelAPI
1+
GExcelAPI
2+
=========
23

3-
GExcelAPI is a thin wrapper library powered by Groovy of Apache POI, not JExcelAPI.
4+
GExcelAPI is a thin Groovy-ish wrapper library of not JExcelAPI but Apache POI.
45

5-
## Usage
66

7-
About its usage, see a following article:
7+
Getting Started
8+
---------------
89

9-
* <http://nobeans-en.blogspot.jp/2011/11/gexcelapi-for-groovyist-using-ms-excel.html>
10+
It's difficult to read and write when using Apache POI directly.
11+
Especially, an identification of a cell to use an index is too complicated and ugly.
1012

11-
and a test code:
13+
```groovy
14+
File inputFile = ...
15+
def book = new HSSFWorkbook(new POIFSFileSystem(new FileInputStream(inputFile)))
16+
def sheet = book.getSheetAt(0) // 1st sheet
17+
println "A1: " + sheet.getRow(0)?.getCell((short) 0)
18+
println "A2: " + sheet.getRow(1)?.getCell((short) 0)
19+
println "B1: " + sheet.getRow(0)?.getCell((short) 1)
20+
```
1221

13-
* <https://github.com/nobeans/gexcelapi/raw/master/src/test/groovy/org/jggug/kobo/gexcelapi/GExcelTest.groovy>
22+
By using GExcelAPI, you can write the above sample like this:
1423

15-
## Code Status
24+
```groovy
25+
File inputFile = ...
26+
def book = GExcel.open(inputFile)
27+
def sheet = book[0] // 1st sheet
28+
println "A1: " sheet.A1.value
29+
println "A2: " sheet.A2.value
30+
println "B1: " sheet.B1.value
31+
```
1632

17-
* [![Build Status](https://drone.io/github.com/nobeans/gexcelapi/status.png)](https://drone.io/github.com/nobeans/gexcelapi/latest)
1833

19-
## License
34+
How to get
35+
-----------
36+
37+
### Grape
38+
39+
```groovy
40+
@GrabResolver(name="bintray", root="http://dl.bintray.com/nobeans/maven")
41+
@GrabConfig(systemClassLoader=true) // necessary if you invoke it by GroovyServ
42+
@Grab("org.jggug.kobo:gexcelapi:0.4")
43+
import org.jggug.kobo.gexcelapi.GExcel
44+
45+
// example...
46+
def book = GExcel.open(args[0])
47+
def sheet = book[0]
48+
println sheet.A1.value
49+
```
50+
51+
52+
Test as Documentation
53+
---------------------
54+
55+
* <https://github.com/nobeans/gexcelapi/blob/master/src/test/groovy/org/jggug/kobo/gexcelapi/GExcelTest.groovy>
56+
57+
58+
Code Status
59+
-----------
60+
61+
[![Build Status](https://travis-ci.org/nobeans/gexcelapi.svg?branch=master)](https://travis-ci.org/nobeans/gexcelapi)
62+
63+
64+
License
65+
-------
2066

2167
GExcelAPI is released under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0)

0 commit comments

Comments
 (0)