Skip to content

About

Add quote " to any cells

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExcelQuote

A Windows batch tool that wraps every data-cell value in double quotes (value → "value") across all Excel files in a folder, using NPOI.

.NET Language UI Library


Overview

ExcelQuote is a small WinForms utility for batch-processing .xlsx files. For every file in a chosen folder, it opens the first worksheet and rewrites each data cell so its value is enclosed in double quotes, then saves the result to an output subfolder. The header row (row 1) is left untouched.

This is handy for preparing spreadsheet data for a downstream system or import format that expects text-qualified (quoted) values.

How it works

  1. Click Browse and select a folder containing .xlsx files
  2. Click the process button
  3. For each file, the app:
    • opens the first sheet via NPOI (XSSFWorkbook)
    • iterates every row except the header, and every column, setting the cell value to "<original value>"
    • writes the modified workbook to <folder>\output\<same filename>

Tech stack

  • C# / .NET Framework 4.5.2, WinForms
  • NPOI — reads and writes Office Open XML (.xlsx) without requiring Excel installed
  • ICSharpCode.SharpZipLib — NPOI dependency for the zip-based .xlsx container

Project structure

ExcelQuote/
├── ExcelQuote.sln
└── ExcelQuote/
    ├── Program.cs        # entry point
    ├── Form1.cs          # UI + batch-quoting logic
    ├── lib/              # NPOI*.dll, ICSharpCode.SharpZipLib.dll
    └── App.config

Build & Run

  1. Open ExcelQuote.sln in Visual Studio (targets .NET Framework 4.5.2)
  2. Ensure the references in lib/ (NPOI and SharpZipLib) resolve
  3. Build and run, then select a folder of .xlsx files and process

Before running: create an output subfolder inside the selected folder (see Known issues).

Known issues / TODO

  • output folder is not created automatically — the app writes to <folder>\output\ but never creates that directory, so it throws DirectoryNotFoundException if it doesn't already exist. Adding Directory.CreateDirectory(pathToDirOutput) before the loop would fix this.
  • Assumes every file is a valid .xlsx — Directory.GetFiles returns all files; a non-xlsx file (or a temp/lock file) will make NPOI throw. Filtering by *.xlsx would be safer.
  • No null-cell handling — empty cells return null from GetCell(j), which can cause a NullReferenceException. Use GetCell(j, MissingCellPolicy.CREATE_NULL_AS_BLANK) or a null check.
  • Column count is taken from the header row's LastCellNum; rows with fewer cells than the header may fail.

Notes

A focused, single-purpose tool. The improvements above would make it robust enough for general reuse; as written it works for clean, uniform .xlsx inputs with a pre-existing output folder.

About

Add quote " to any cells

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages