Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sashka/xlsxio-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A thin XLSX I/O wrapper for Zig

Only the read functionality of XLSX I/O is wrapped here since I only need to read XLSX files.

const xlsxio = @import("xlsxio");

pub fn main() !void {
    const allocator = std.heap.page_allocator;
    
    // Open an XLSX file
    var reader = try xlsxio.Reader.open(allocator, "data.xlsx");
    defer reader.close();
    
    // Open the first sheet
    var sheet = try reader.openSheet(null, .{});
    defer sheet.close();
    
    // Read all rows and cells
    while (sheet.nextRow()) {
        while (sheet.nextCell()) |cell| {
            std.debug.print("{s}\t", .{cell});
            xlsxio.free(cell);
        }
        std.debug.print("\n", .{});
    }
}

Install

I use this package as part of a project source tree like "/pkg/xlsxio", so my build.zig.zon looks like this:

.dependencies = .{
    .xlsxio = .{
        .path = "pkg/xlsxio",
    },
},

API

The main types are:

  • Reader - for opening and managing XLSX files
  • Sheet - for reading worksheet data
  • SheetList - for enumerating worksheets

License

MIT License, same as the underlying XLSX I/O library.

About

A thin XLSX I/O wrapper for Zig

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published