A modern, feature-rich CSV editor built with Java and SWT
Features • Installation • Usage • Architecture • Documentation
|
|
|
|
- ☕ Java 25+ (with GraalVM support for native compilation)
- 📦 Gradle (wrapper included)
# Clone the repository
git clone https://github.com/yourusername/CSVedit.git
cd CSVedit
# Build the project
./gradlew build
# Run the application
./gradlew run# Create executable JAR
./gradlew jar
# Create distribution packages
./gradlew distZip distTar
# Build native image (GraalVM required)
./gradlew nativeCompile
# Run tests
./gradlew testThe project declares its dependencies in build.gradle. Below are the main runtime, build-time (native), and test dependencies with the versions currently used in this repository.
-
Runtime / Implementation
- Java: Java 25 (configured via Gradle toolchain)
- CSV parsing library:
com.github.seerainer:CSVparser:0.2.1 - JSON utilities:
com.grack:nanojson:1.10 - SWT (GUI):
org.eclipse.platform:org.eclipse.swt.<platform>:3.132.0(platform-specific artifact is selected dynamically inbuild.gradleviadetectSwtArtifact(); the artifact suffix depends on OS and architecture)
-
Test
- JUnit Jupiter:
org.junit.jupiter:junit-jupiter:6.0.1 - AssertJ (assertions):
org.assertj:assertj-core:3.27.6
- JUnit Jupiter:
- Launch the editor:
./gradlew run - Open a CSV file:
Ctrl+Oor drag & drop - Edit cells: Double-click any cell
- Save changes:
Ctrl+S
| Action | Shortcut | Description |
|---|---|---|
| 📄 New | Ctrl+N |
Create new CSV file |
| 📂 Open | Ctrl+O |
Open existing file |
| 💾 Save | Ctrl+S |
Save current file |
| 💾 Save As | Ctrl+Shift+S |
Save with new name |
| ↩️ Undo | Ctrl+Z |
Undo last action |
| ↪️ Redo | Ctrl+Y |
Redo last undone action |
| ➕ Add Row | Ctrl+R |
Insert new row |
| ➕ Add Column | Ctrl+L |
Insert new column |
| ❌ Delete Row | Ctrl+D |
Delete selected row |
| 🔍 Find | Ctrl+F |
Open search dialog |
| 📝 Text Editor | Ctrl+T |
Edit as plain text |
| 🔄 Refresh | F5 |
Refresh display |
CSVedit can open and save gzip-compressed CSV files using the .csv.gz extension. This lets you work with compressed CSVs directly (open/edit/save) without manually decompressing or recompressing files.
- New (
Ctrl+N) - Create a new CSV file - Open (
Ctrl+O) - Open an existing CSV file - Save (
Ctrl+S) - Save the current file - Save As (
Ctrl+Shift+S) - Save with a new filename - Import → From JSON/XML - Import data from various formats
- Export → To JSON/XML - Export data to various formats
- Exit - Close the application
- Undo (
Ctrl+Z) - Undo the last action - Redo (
Ctrl+Y) - Redo the previously undone action - Add Row (
Ctrl+R) - Add a new row to the table - Add Column (
Ctrl+L) - Add a new column to the table - Delete Row (
Ctrl+D) - Delete the selected row - Delete Column - Remove the last column
- Find (
Ctrl+F) - Search for text in the table
- Refresh (
F5) - Refresh the table display - Text Editor (
Ctrl+T) - Edit CSV data as plain text - Settings - Configure application preferences
- About - Display application information
📋 CSV Configuration
- Field Delimiter - Character to separate fields (default: comma)
- Quote Character - Character for quoting special fields (default:
") - Escape Character - Character to escape quotes (default:
") - Trim Whitespace - Remove leading/trailing spaces
- Detect BOM - Handle UTF-8 BOM detection
- Performance Settings - Buffer size, max field size
🔍 Parsing Options
- Preserve Empty Fields - Keep empty fields in data
- Skip Empty Lines - Ignore empty data lines
- Skip Blank Lines - Ignore completely blank lines
- Null Value Handling - Custom null representation
🚀 Advanced Parsing
- Quoting Options - Strict quoting rules
- Line Ending Options - Normalize line endings
- Record Validation - Max record length, error handling
- Debugging - Track field positions
🖥️ UI Options
- Default Table Size - Rows (1-1000), Columns (1-100)
- Column Width - 50-1000 pixels (default: 150)
- Display Options - Show grid lines
- Behavior - Auto-save, delete confirmations
📂 File Options
- Character Encoding - UTF-8, UTF-16, ISO-8859-1, Windows-1252, US-ASCII
- Line Ending - System, Windows (CRLF), Unix (LF), Mac (CR)
🖋️ Font Options
- Font Selection - Family, size, style
- Live Preview - See changes in real-time
- Custom Fonts - Choose any system font
┌─────────────────────────────────────────────────────────┐
│ Main.java │
│ (Application Entry Point) │
└─────────────────────┬───────────────────────────────────┘
│
┌─────────────────────▼───────────────────────────────────┐
│ MainWindow.java │
│ (UI Manager & Event Coordinator) │
└─┬─────────┬─────────┬─────────┬─────────┬───────────────┘
│ │ │ │ │
▼ ▼ ▼ ▼ ▼
┌────┐ ┌──────┐ ┌──────┐ ┌──────┐ ┌────────┐
│Data│ │Table │ │File │ │Theme │ │Settings│
│Mgmt│ │Mgmt │ │Ops │ │Mgr │ │Dialog │
└────┘ └──────┘ └──────┘ └──────┘ └────────┘
| Component | Responsibility |
|---|---|
| CSVTableModel | Data storage & manipulation |
| TableManager | Table UI operations |
| FileOperations | CSV file I/O with CSVParser |
| JSONOperations | JSON import/export |
| XMLOperations | XML import/export |
| UndoRedoManager | Command pattern for undo/redo |
| FindReplaceDialog | Advanced search & replace |
| LazyCSVLoader | Large file handling with async loading |
| ThemeManager | Dark/light theme support |
| SettingsDialog | Configuration UI with 6 tabs |
| Icons | Centralized icon management (singleton) |
| DuplicateRowsDialog | Find and remove duplicate rows |
📊 Total Tests: 60
✅ Passing: 60 (100%)
❌ Failing: 0
Unit Tests (24):
✓ CSVTableModelTest - Data model operations
✓ CSVParserCallbackTest - Callback-based CSV parsing
Integration Tests (36):
✓ FileOperationsTest - File I/O operations
✓ TextEditorDialogTest - Text editor/preview behavior
# All tests
./gradlew test
# Unit tests only
./gradlew unitTest
# Integration tests only
./gradlew integrationTest
# With detailed output
./gradlew test --info- ✅ Standard comma-separated values
- ✅ Custom delimiters
- ✅ Quoted fields with commas
- ✅ Escaped quotes (
"") - ✅ Multi-line values
- ✅ Empty fields
- ✅ UTF-8 BOM detection
{
"headers": ["Name", "Age", "City"],
"rows": [
["Alice", "30", "New York"],
["Bob", "25", "London"]
]
}<csv>
<headers>
<header>Name</header>
<header>Age</header>
</headers>
<rows>
<row>
<cell>Alice</cell>
<cell>30</cell>
</row>
</rows>
</csv>- 🔤 Case-sensitive/insensitive matching
- 📝 Whole word matching
- 🔄 Find Next / Replace / Replace All
- 🎯 Cell-by-cell navigation
- 📊 Scan entire dataset for duplicates
- 👁️ Visual preview of duplicate rows
- 🎯 Selective or batch removal
- 📈 Real-time statistics
- ✅ Undo support for removals
- 📦 Lazy loading for large files (>10MB)
- 📊 Progress dialog with cancel button
- 💾 Efficient memory usage with resource pooling
- 🚀 Chunk-based async processing
- ⏱️ Background loading with progress updates
- 🧹 Automatic resource cleanup
- 🌓 Automatic dark theme detection
- 💾 Dirty state tracking with visual indicator (*)
⚠️ Smart confirmation dialogs- 📊 Status bar with file statistics
- 🖱️ Intuitive right-click context menus
- 🔄 Auto-save every 30 seconds
- ⌨️ Comprehensive keyboard shortcuts
- 🎯 Drag & drop support for CSV/JSON/XML
| Technology | Purpose |
|---|---|
| Java 25 | Core language with modern features |
| SWT | Native UI framework (Eclipse Standard Widget Toolkit) |
| CSVParser v0.2.1 | Robust, configurable CSV parsing |
| JUnit Jupiter 6.0.1 | Modern testing framework |
| AssertJ 3.27.6 | Fluent test assertions |
| GraalVM | Native image compilation support |
| Gradle 9.2.1 | Build automation & dependency management |
- 🏗️ Separation of Concerns - Clear Model-View separation
- 🧪 Test-Driven Development - Comprehensive unit & integration tests
- ⚡ Performance First - Optimized for large datasets
- 🎨 User-Centric Design - Intuitive UI with helpful feedback
- 🔧 Highly Configurable - Extensive customization options
- 📦 Zero Configuration - Works out of the box with sensible defaults
- 🌍 Cross-Platform - Windows, macOS, Linux support
- 🧹 Resource Management - Proper lifecycle management following SWT best practices
- ♿ Accessibility - Keyboard navigation and screen reader support
- 🔒 Data Integrity - Undo/redo with data validation
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to fork and submit a Pull Request.
For questions or support, please open an issue on GitHub.
Made with ☕ and ❤️
⭐ Star this repo if you find it useful!