Lexerow 0.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Lexerow --version 0.3.0
                    
NuGet\Install-Package Lexerow -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lexerow" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Lexerow" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="Lexerow" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Lexerow --version 0.3.0
                    
#r "nuget: Lexerow, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Lexerow@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Lexerow&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=Lexerow&version=0.3.0
                    
Install as a Cake Tool

What is Lexerow ?

Lexerow is a backend dotnet library to process easily datarows and cells in Excel files.

For example you can detect empty cell in a column and set a specific value. You can compare a cell value to a specific value and then put a new value in the same cell row or in another cell.

Lexerow is developed in C# and can be used in any dotnet application.

Lexerow is an open source library.

A quick example

Problem: empty cells

You have an Excel file containing a datatable in the first sheet: the first line is the header, and others are datarows of the table. In column B, some cells are empty, and it's a problem to do calculation. It would better to have a value in each cell.

+------+-------+
|  Id  | Value |
+------+-------+
|   1  |   12  |
|   2  |       |  <= is empty!
|   3  |  234  |
|   4  |       |  <= is empty!
|   5  |  631  |
+------+-------+

So to put the value 0 in each empty cell in column B, Lexerow will help you to do that easily with some lines of code.

+------+-------+
|  Id  | Value |
+------+-------+
|   1  |   12  |
|   2  |    0  |  <= set to 0
|   3  |  234  |
|   4  |    0  |  <= set to 0
|   5  |  631  |
+------+-------+

The solution, in 2 stages

-Create a script to fix cell values in the Excel datatable.

-Execute the script in a C# program.

The Script to fix values

To process datarow of the excel file as explained, Lexerow provide a powerful instruction which is: OnExcel ForEachRow If/Then.

Let's consider the excel file to fix blank values is "MyFile.xlsx"

Create a basic script and save it "MyScript.lxrw"

# process datarow of the Excel, one by one
OnExcel "MyFile.xlsx"
    ForEachRow
	  If B.Cell=null Then B.Cell=0
    Next
End OnExcel	

This a very basic script, but of course it's possible to create more complex script to manage your cases.

A C# program to execute the script

Create a program in C# and use the Lexerow library in this way:

// create the core engine
LexerowCore core = new LexerowCore();

// load and execute the script   
core.LoadExecScript("MyScript", MyScript.lxrw);   

This is the minimum C# program you have to write.

Project Github

The source code is hosted on github here:

https://github.com/Pierlam/Lexerow

Project Wiki

It's possible to check many cases in If instruction.

If A.Cell=12
If A.Cell>8.55
If A.Cell<>"Hello"
If A.Cell=blank
If A.Cell=null

In Then part, you can set a value to a cell. Type of value can be: int, double, string.

To clear the cell value, you have to put blank. The formating of the cell will remain: background color and border.

To remove completly a cell, to have to set it to null.

Then A.Cell=13
Then A.Cell=25.89
Then A.Cell="Hello"
Then A.Cell=blank
Then A.Cell= null

You can find more information on how use all available functions on the library here:

https://github.com/Pierlam/Lexerow/wiki

Dependency

To access Excel content file, Lexerow uses the great NPOI library found on Nuget here:

https://www.nuget.org/packages/NPOI

NPOI source code is hosted on github here:

https://github.com/nissl-lab/npoi

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.0 104 1/10/2026
0.4.0 186 11/23/2025
0.3.0 300 11/16/2025
0.2.0 212 6/22/2025
0.1.1 276 4/13/2025
0.1.0 259 4/8/2025