Skip to content

About

A lightweight WPF desktop tool for generating repeated text with named numeric variables, live preview, padding, clipboard support, and text export.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Incremental Text Generator

Incremental Text Generator preview

A lightweight WPF desktop tool for generating repeated text from named numeric variables, with live preview, configurable increments, number padding, clipboard support, and text-file export.


Overview

Incremental Text Generator is a Windows desktop utility built with C# and WPF (net10.0-windows). It allows developers, QA engineers, and system administrators to write a single or multi-line text template containing named placeholders such as {{item}} or {{value}}, configure each variable's starting number, step increment, and zero-padding width, and immediately preview and export up to 10,000 generated lines.


Screenshot

Main Application Window Animated Live Preview
Application Screenshot Animated Preview

Features

  • Named Numeric Variables: Define readable, self-documenting placeholders using {{variableName}} syntax instead of cryptic single-character symbols.
  • Automatic Variable Detection: Variables are automatically extracted in the exact order of their first appearance in the template. Duplicate placeholders within the template share a single configuration row and evaluate to the same value on each line.
  • 64-Bit Integer Arithmetic (long): Supports positive, zero, and negative Start and Step values with checked overflow detection.
  • Sign-Preserving Zero Padding: Pad numbers up to 12 digits (0–12) while keeping negative signs in front of the padded digits (for example, -002, -001, 000, 001).
  • Debounced Asynchronous Live Preview: Automatically recalculates output ~180 ms after edits on a background thread so the UI remains responsive even at 10,000 lines.
  • Explicit Export Actions: Copy generated text to the Windows clipboard on demand (Copy All) or export to a UTF-8 .txt file (Save as Text). Never overwrites the user's clipboard automatically.
  • One-Click Reset: Instantly restore the default template, line count, and variable settings.

Variable Syntax

Placeholders use double curly braces:

{{variableName}}

Variable names are case-sensitive and must match the regular expression:

[A-Za-z_][A-Za-z0-9_]*
Valid Examples Invalid Examples Reason
{{index}} {{123}} Cannot start with a digit
{{item_number}} {{item-name}} Hyphens are not allowed
{{Value2}} {{ }} / {{}} Variable name cannot be empty
{{_offset}} {{unclosed Missing closing }}

Example

Template

Item {{item}} = Value {{value}}

Variable Settings

item:  Start = 1,   Step = 1,  Padding = 2
value: Start = 100, Step = 10, Padding = 0

Generated Output (first 3 lines)

Item 01 = Value 100
Item 02 = Value 110
Item 03 = Value 120

Negative Start with Zero Padding

Start = -2, Step = 1, Padding = 3

Output:

-002
-001
000
001

Requirements

  • Operating System: Windows 10 or Windows 11 (x64)
  • For Running the Published Release: No runtime installation required (self-contained single-file executable)
  • For Building from Source: .NET 10.0 SDK (or newer) with Windows Desktop workload

Download

Prebuilt Windows releases are available from the GitHub Releases page.

  1. Download IncrementalTextGenerator-v1.0.0-win-x64.zip.
  2. Extract the ZIP file.
  3. Run IncrementalTextGenerator.exe.

The published application is self-contained, so a separate .NET installation is not required.


Build from Source

dotnet build IncrementalTextGenerator.slnx --configuration Release

Publish a Standalone EXE

dotnet publish IncrementalTextGenerator.csproj --configuration Release --runtime win-x64 --self-contained true -p:PublishSingleFile=true

The self-contained standalone executable will be output to:

artifacts/publish/win-x64/IncrementalTextGenerator.exe

Platform Notes

  • Prebuilt releases target 64-bit Windows (x64) on Windows 10 or Windows 11.
  • ARM64 users can build and publish directly from source using --runtime win-arm64.
  • Unsigned open-source executables may trigger a Windows SmartScreen prompt on first run ("Windows protected your PC"). Click More info and select Run anyway.
  • This binary is not digitally code-signed.

How to Run

Option 1: Run the Prebuilt Single-File Executable

Launch the standalone executable:

.\IncrementalTextGenerator.exe

Option 2: Run from Source with .NET CLI

dotnet run --project IncrementalTextGenerator.csproj

Project Structure

IncrementalTextGenerator/
├─ Models/
│  └─ SequenceVariable.cs
├─ Services/
│  ├─ TemplateParser.cs
│  └─ TextGenerator.cs
├─ ViewModels/
│  └─ MainViewModel.cs
├─ IncrementalTextGenerator.Tests/
│  ├─ IncrementalTextGenerator.Tests.csproj
│  ├─ TemplateParserTests.cs
│  └─ TextGeneratorTests.cs
├─ Properties/
│  └─ PublishProfiles/
│     └─ win-x64.pubxml
├─ assets/
│  ├─ app.ico
│  ├─ screenshot.png
│  └─ preview.gif
├─ App.xaml
├─ App.xaml.cs
├─ MainWindow.xaml
├─ MainWindow.xaml.cs
├─ IncrementalTextGenerator.csproj
├─ IncrementalTextGenerator.slnx
├─ README.md
├─ LICENSE
└─ .gitignore

Input Validation

For every line index i (starting at i = 0), each variable is evaluated as:

$$\text{value}_i = \text{Start} + \text{Step} \times i$$

  • Template Validation: Detects empty templates, unclosed {{, unmatched }}, single braces, and invalid variable identifiers.
  • Line Count Validation: Enforces whole numbers between 1 and 10,000.
  • Variable Field Validation: Verifies Start and Step are valid 64-bit integers (long) and Padding is between 0 and 12.
  • Overflow Protection: Uses checked 64-bit arithmetic. If Start + Step * i exceeds long.MaxValue or long.MinValue, generation stops immediately and reports the exact variable and line number.
  • Safe Error Recovery: When any input is invalid, the problematic field is highlighted, Copy All and Save as Text are disabled, and the last valid preview output is preserved rather than overwritten with corrupted text.

Testing

Automated unit tests are located in IncrementalTextGenerator.Tests and cover:

  1. Single variable parsing
  2. Multiple variables parsing
  3. Duplicate variable occurrences in a template
  4. First-appearance variable ordering and case sensitivity
  5. Invalid and incomplete variable syntax handling
  6. Empty and whitespace templates
  7. Templates without variables
  8. Positive Step sequences
  9. Negative Step sequences
  10. Zero Step sequences
  11. Positive Padding formatting
  12. Negative number Padding formatting (preserving the leading - sign)
  13. Multi-variable text generation
  14. 64-bit numeric overflow detection (long.MaxValue / long.MinValue)
  15. Maximum line count boundary (1 to 10,000) and ViewModel state transitions

Run all tests with:

dotnet test IncrementalTextGenerator.slnx --configuration Release

No Third-Party Runtime Dependencies

The WPF application relies exclusively on the .NET Base Class Library (System.*, Microsoft.Win32.SaveFileDialog, and standard WPF controls). No third-party UI toolkits, MVVM frameworks, template engines, or clipboard libraries are bundled at runtime.


Known Limitations

  • Maximum line count per generation is capped at 10,000 lines to guarantee instant UI responsiveness.
  • Variables perform linear integer arithmetic (Start + Step * i); arbitrary mathematical expressions, floating-point increments, or conditional branches are intentionally out of scope.
  • Single curly braces ({ or }) are treated as incomplete variable tokens and flagged by the parser to prevent accidental typos when writing {{variableName}}.

Suggested GitHub Topics

wpf csharp dotnet text-generator template-engine developer-tools desktop-app clipboard windows


License

This project is licensed under the MIT License.

About

A lightweight WPF desktop tool for generating repeated text with named numeric variables, live preview, padding, clipboard support, and text export.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages