All Projects → ahmedwalid05 → Fastexcel

ahmedwalid05 / Fastexcel

Licence: mit
Fast Excel Reading and Writing in .Net

Labels

Projects that are alternatives of or similar to Fastexcel

Xlwings
xlwings is a BSD-licensed Python library that makes it easy to call Python from Excel and vice versa. It works with Microsoft Excel on Windows and macOS.
Stars: ✭ 2,181 (+923.94%)
Mutual labels:  excel
Fast excel
Ultra Fast Excel Writer for Ruby
Stars: ✭ 181 (-15.02%)
Mutual labels:  excel
Vue Blog
🎉 基于vue全家桶 + element-ui 构建的一个后台管理集成解决方案
Stars: ✭ 208 (-2.35%)
Mutual labels:  excel
Excelmapper
Map POCO objects to Excel files
Stars: ✭ 166 (-22.07%)
Mutual labels:  excel
Angular Handsontable
Angular Data Grid with Spreadsheet Look & Feel. Official Angular wrapper for Handsontable.
Stars: ✭ 175 (-17.84%)
Mutual labels:  excel
Calx.js
jQuery Calx - a jQuery plugin for creating formula-based calculation form
Stars: ✭ 190 (-10.8%)
Mutual labels:  excel
Writexl
Portable, light-weight data frame to xlsx exporter for R
Stars: ✭ 162 (-23.94%)
Mutual labels:  excel
Excel to code
Roughly translate some Excel spreadsheets to Ruby or C.
Stars: ✭ 214 (+0.47%)
Mutual labels:  excel
Excel Parser Processor
Simply does the tedious, repetitive operations for all rows of excel files step by step and reports after the job is done. It can download files from URL(s) in a column of Excel files. If a new filename is provided at column B it will rename the file before saving. It will even create sub folders if column C is full with a valid folder name.
Stars: ✭ 177 (-16.9%)
Mutual labels:  excel
Vue Easytable
🍉 Table Component/ Data Grid / Data Table.Support Virtual Scroll,Column Fixed,Header Fixed,Header Grouping,Filter,Sort,Cell Ellipsis,Row Expand,Row Checkbox ...
Stars: ✭ 2,501 (+1074.18%)
Mutual labels:  excel
Xlsxir
Xlsx parser for the Elixir language.
Stars: ✭ 167 (-21.6%)
Mutual labels:  excel
Ditching Excel For Python
Functionalities in Excel translated to Python
Stars: ✭ 172 (-19.25%)
Mutual labels:  excel
Img2xls
Convert images to colored cells in an Excel spreadsheet.
Stars: ✭ 200 (-6.1%)
Mutual labels:  excel
Basic Excel R Toolkit
Stars: ✭ 166 (-22.07%)
Mutual labels:  excel
Closedxml
ClosedXML is a .NET library for reading, manipulating and writing Excel 2007+ (.xlsx, .xlsm) files. It aims to provide an intuitive and user-friendly interface to dealing with the underlying OpenXML API.
Stars: ✭ 2,799 (+1214.08%)
Mutual labels:  excel
Xresloader
跨平台Excel导表工具(Excel=>protobuf/msgpack/lua/javascript/json/xml)
Stars: ✭ 161 (-24.41%)
Mutual labels:  excel
Ariawase
Ariawase is free library for VBA cowboys.
Stars: ✭ 185 (-13.15%)
Mutual labels:  excel
Autopoi
AutoPOI 功能如同名字auto,追求的就是自动化,让一个没接触过poi的人员,可以傻瓜化的快速实现Excel导入导出、Word模板导出、可以仅仅5行代码就可以完成Excel的导入导出。
Stars: ✭ 213 (+0%)
Mutual labels:  excel
Flutter sheet localization
Generate Flutter localization from a simple online Google Sheets.
Stars: ✭ 212 (-0.47%)
Mutual labels:  excel
Office Ribbonx Editor
An overhauled fork of the original Custom UI Editor for Microsoft Office, built with WPF
Stars: ✭ 205 (-3.76%)
Mutual labels:  excel

Fast Excel

Build / Release

Build status License NuGet Badge

About

  • Provides a fast way of reading and writing to *.xlsx Excel files.
  • Small memory footprint while running
  • Does not use the Open XML SDK to interact with the data but going directly and editing the underlying xml files.
  • This project is not intended to be a replacement for full featured Excel packages with things like formatting, just light weight fast way of interacting with data in Excel.

Version 3

  • Contribute using Visual Studio 2017
  • Built using .NetStandard 2 targeting:
    • .Net Core 2.0
    • .Net Framework 4.6.1

Installation

PM> Install-Package FastExcel

Write Demo 1

This demo uses Generic objects, ie any object you wish with public properties

// Get your template and output file paths
var templateFile = new FileInfo("C:\\Temp\\Template.xlsx");
var outputFile = new FileInfo("C:\\Temp\\output.xlsx");

using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(templateFile, outputFile))
{
    List<MyObject> objectList = new List<MyObject>();

    for (int rowNumber = 1; rowNumber < 100000; rowNumber++)
    {
        MyObject genericObject = new MyObject();
        genericObject.StringColumn1 = "A string " + rowNumber.ToString();
        genericObject.IntegerColumn2 = 45678854;
        genericObject.DoubleColumn3 = 87.01d;
        genericObject.ObjectColumn4 = DateTime.Now.ToLongTimeString();

        objectList.Add(genericObject);
    }
    fastExcel.Write(objectList, "sheet3", true);
}
public class MyObject
{
    public string StringColumn1 { get; set; }
    public int IntegerColumn2 { get; set; }
    public double DoubleColumn3 { get; set; }
    public string ObjectColumn4 { get; set; }
}

Write Demo 2

This demo lets you specify exactly which cell you are writing to

// Get your template and output file paths
var templateFile = new FileInfo("C:\\Temp\\Template.xlsx");
var outputFile = new FileInfo("C:\\Temp\\output.xlsx");

//Create a worksheet with some rows
var worksheet = new Worksheet();
var rows = new List<Row>();
for (int rowNumber = 1; rowNumber < 100000; rowNumber++)
{
    List<Cell> cells = new List<Cell>();
    for (int columnNumber = 1; columnNumber < 13; columnNumber++)
    {
        cells.Add(new Cell(columnNumber, columnNumber * DateTime.Now.Millisecond));
    }
    cells.Add(new Cell(13, "Hello" + rowNumber));
    cells.Add(new Cell(14, "Some Text"));
 
    rows.Add(new Row(rowNumber, cells));
}
worksheet.Rows = rows;


// Create an instance of FastExcel
using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(templateFile, outputFile))
{
    // Write the data
    fastExcel.Write(worksheet, "sheet1");
}

Read Demo 1 Get Worksheet

// Get the input file path
var inputFile = new FileInfo("C:\\Temp\\input.xlsx");

//Create a worksheet
Worksheet worksheet = null;

// Create an instance of Fast Excel
using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(inputFile, true))
{
    // Read the rows using worksheet name
    worksheet = fastExcel.Read("sheet1");

    // Read the rows using the worksheet index
    // Worksheet indexes are start at 1 not 0
    // This method is slightly faster to find the underlying file (so slight you probably wouldn't notice)
    worksheet = fastExcel.Read(1);
}

Read Demo 2 Get All Worksheets

// Get the input file path
var inputFile = new FileInfo("C:\\Temp\\fileToRead.xlsx");

// Create an instance of Fast Excel
using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(inputFile, true))
{
    foreach (var worksheet in fastExcel.Worksheets)
    {
        Console.WriteLine(string.Format("Worksheet Name:{0}, Index:{1}", worksheet.Name, worksheet.Index));
        
        //To read the rows call read
        worksheet.Read();
        var rows = worksheet.Rows.ToArray();
        //Do something with rows
        Console.WriteLine(string.Format("Worksheet Rows:{0}", rows.Count()));
    }
}

Update Demo

// Get the input file path
var inputFile = new FileInfo("C:\\Temp\\input.xlsx");

//Create a some rows in a worksheet
var worksheet = new Worksheet();
var rows = new List<Row>();

for (int rowNumber = 1; rowNumber < 100000; rowNumber += 50)
{
    List<Cell> cells = new List<Cell>();
    for (int columnNumber = 1; columnNumber < 13; columnNumber+= 2)
    {
        cells.Add(new Cell(columnNumber, rowNumber));
    }
    cells.Add(new Cell(13, "Updated Row"));

    rows.Add(new Row(rowNumber, cells));
}
worksheet.Rows = rows;

// Create an instance of Fast Excel
using (FastExcel.FastExcel fastExcel = new FastExcel.FastExcel(inputFile))
{
    // Read the data
    fastExcel.Update(worksheet, "sheet1");
}

Thanks to

  • Sibz

  • paritoshmmmec

  • Insperation for this project came from SejExcelExport by jsegarra1971 who did a great job. I wanted to have my own crack at this problem.

  • mrjono1 The creater of this library

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].