No description
Find a file
dependabot[bot] d354ba4a8c
Bump actions/checkout from 4 to 5 (#30)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-18 17:37:11 +08:00
.github Bump actions/checkout from 4 to 5 (#30) 2025-08-18 17:37:11 +08:00
docs Create CNAME 2021-08-19 13:45:31 +08:00
src add float value (0.0) to FORMATS table (#25) 2024-11-25 17:24:38 +08:00
tests fixes for ARC (#27) 2024-11-24 20:03:10 +08:00
.gitignore docs 2019-12-28 17:29:13 +08:00
azure-pipelines.yml Update azure-pipelines.yml 2020-01-25 21:50:22 +08:00
LICENSE workbook 2019-12-11 20:45:50 +08:00
README.md Update README.md 2022-11-13 20:35:10 +08:00
xlsx.nimble Update xlsx.nimble 2022-11-13 20:35:39 +08:00

Build Status

xlsx nimble

Parse xlsx written in Nim.[WIP]

Docs

Docs in https://ringabout.github.io/xlsx/utils.html

Usage

Parse Excel without header.

import xlsx


let
  data = parseExcel("tests/test.xlsx")
  sheetName = "Sheet2"
echo data[sheetName]

output:

+----------+----------+----------+
|name      |grade     |age       |
|simon     |          |14        |
|tom       |87        |34        |
+----------+----------+----------+

Parse Excel with header.

import xlsx


let
  data = parseExcel("tests/test.xlsx", header = true)
  sheetName = "Sheet2"
echo data[sheetName]

output:

+----------+----------+----------+
|name      |grade     |age       |
+----------+----------+----------+
|simon     |          |14        |
|tom       |87        |34        |
+----------+----------+----------+

Parse Excel and skip header for data processing.

import xlsx


let
  data = parseExcel("tests/test.xlsx", skipHeaders = true)
  sheetName = "Sheet2"
echo data[sheetName]

output:

+----------+----------+----------+
|simon     |          |14        |
|tom       |87        |34        |
+----------+----------+----------+

Convert to Csv

import xlsx


let sheetName = "Sheet2"
let data = parseExcel("tests/test.xlsx")
data[sheetName].toCsv("tests/test.csv", sep = ",")

output:

name,grade,age
simon,,14
tom,87,34

Loop through rows:

import xlsx

let sheetName = "Sheet2"
let data = parseExcel("tests/test.xlsx")
let rows = data[sheetName].toSeq(false)
for row in rows:
  echo row

output:

@["name", "grade", "age"]
@["simon", "", "14"]
@["tom", "87", "34"]

Loop through rows and skip headers:

import xlsx

let sheetName = "Sheet2"
let data = parseExcel("tests/test.xlsx")
let rows = data[sheetName].toSeq(true)
for row in rows:
  echo "Name is: " & row[0]

output:

Name is: simon
Name is: tom