Skip to content

Commit

Permalink
#18 英語ドキュメントの追加
Browse files Browse the repository at this point in the history
  • Loading branch information
webarata3 committed Aug 4, 2016
1 parent 132754b commit aa317b6
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 17 deletions.
57 changes: 57 additions & 0 deletions README.ja.md
@@ -0,0 +1,57 @@
# KExcelAPI [![Build Status](https://travis-ci.org/webarata3/KExcelAPI.svg?branch=master)](https://travis-ci.org/webarata3/KExcelAPI) [![Coverage Status](https://coveralls.io/repos/webarata3/KExcelAPI/badge.svg?branch=master&service=github)](https://coveralls.io/github/webarata3/KExcelAPI?branch=master)

Kotlin用のApache POIのラッパーです。皆さん大好きなExcelをできるだけ簡単にアクセスできるように考えています。

このライブラリーは[GExcelAPI](https://github.com/nobeans/gexcelapi)から影響を受けて作成しています。

## 使い方

シートから、セル名かセルのインデックスを指定してCellオブジェクトを取得することができます。
セルオブジェクトからのデータの取得には型が必要なので、toInt、toDouble、toStr等のメソッドで値を取得します。
データのセットの場合には型が自明なため、「=」でExcel上に値をセットできます。

使い方の基本としては、拡張関数を使用しているため `link.arata.kexcelapi.*` パッケージをimportします。

```kotlin
import link.arata.kexcelapi.*
```

これだけで準備は完了です。これで、次のようにExcelへアクセスできます。

```kotlin
// 簡単にファイルオープン、クローズ
KExcel.open("file/book1.xlsx").use { workbook ->
val sheet = workbook[0]

// セルの読み込み
// セル名でのアクセス
println("""B7=${sheet["B7"].toStr()}""")
// セルのインデックスでのアクセス [x, y]
println("B7=${sheet[1, 6].toDouble()}")
println("B7=${sheet[1, 6].toInt()}")

// セルの書き込み
sheet["A1"] = "あいうえお"
sheet[3, 7] = 123

// ファイルの書き込みも簡単に
KExcel.write(workbook, "file/book2.xlsx")
}
```

## Maven

Mavenのリポジトリ(Gradleの設定)は次のとおりです。

```groovy
repositories {
maven { url 'https://raw.githubusercontent.com/webarata3/maven/master/repository' }
}
dependencies {
compile 'link.arata.kexcelapi:kexcelapi:0.1.0'
}
```

## ライセンス
MIT
38 changes: 21 additions & 17 deletions README.md
@@ -1,47 +1,51 @@
# KExcelAPI [![Build Status](https://travis-ci.org/webarata3/KExcelAPI.svg?branch=master)](https://travis-ci.org/webarata3/KExcelAPI) [![Coverage Status](https://coveralls.io/repos/webarata3/KExcelAPI/badge.svg?branch=master&service=github)](https://coveralls.io/github/webarata3/KExcelAPI?branch=master)

Kotlin用のApache POIのラッパーです。皆さん大好きなExcelをできるだけ簡単にアクセスできるように考えています。
[Japanese](/README.ja.md)

このライブラリーは[GExcelAPI](https://github.com/nobeans/gexcelapi)から影響を受けて作成しています。
It is a wrapper for Apache Poi written in Kotlin.
We believe to be able to as easy as possible to access the Excel.

## 使い方
This library has been affected from x [GExcelAPI](https://github.com/nobeans/gexcelapi).

シートから、セル名かセルのインデックスを指定してCellオブジェクトを取得することができます。
セルオブジェクトからのデータの取得には型が必要なので、toInt、toDouble、toStr等のメソッドで値を取得します。
データのセットの場合には型が自明なため、「=」でExcel上に値をセットできます。
## How to use

使い方の基本としては、拡張関数を使用しているため `link.arata.kexcelapi.*` パッケージをimportします。
By specifying the index of the cell name or cell from a sheet, you can get the Cell object.

Since the acquisition of data from the cell object type is needed, to get the value in the method of `toInt` , `toDouble` , `toStr` , etc.
Because in the case of a set of data type is self-evident, you can set a value on the Excel in the "=".

The first step is to import the `link.arata.kexcelapi.*` package because you are using an extension function.

```kotlin
import link.arata.kexcelapi.*
```

これだけで準備は完了です。これで、次のようにExcelへアクセスできます。
It's ready to go. Now, you can access to Excel as follows.

```kotlin
// 簡単にファイルオープン、クローズ
// Easy file open, close
KExcel.open("file/book1.xlsx").use { workbook ->
val sheet = workbook[0]

// セルの読み込み
// セル名でのアクセス
// Reading of the cell
// Access at the cell name
println("""B7=${sheet["B7"].toStr()}""")
// セルのインデックスでのアクセス [x, y]
// Access of the index of the cell [x, y]
println("B7=${sheet[1, 6].toDouble()}")
println("B7=${sheet[1, 6].toInt()}")

// セルの書き込み
sheet["A1"] = "あいうえお"
// Writing of cell
sheet["A1"] = "ABCDE"
sheet[3, 7] = 123

// ファイルの書き込みも簡単に
// Also easy writing of files
KExcel.write(workbook, "file/book2.xlsx")
}
```

## Maven

Mavenのリポジトリ(Gradleの設定)は次のとおりです。
Maven(or Gradle) repository is as follows.

```groovy
repositories {
Expand All @@ -53,5 +57,5 @@ dependencies {
}
```

## ライセンス
## License
MIT

0 comments on commit aa317b6

Please sign in to comment.