csv-to-array is a Visual Studio Code extension that converts CSV files into ready-to-use matix structures for diffferent programming languages (C/C#/JavaScript/Python).
It displays your CSV in an interactive spreadsheet-like editor, lets you modify
the data, and generates clean, idiomatic code depending on the selected language
and version.
This project was originally designed to convert CSV-based automaton representations into C# data structures.
Features
📂 Open CSV in an editable grid
Load any .csv file into a clean interactive table inside VS Code.
Add rows and columns.
Edit cell values in real-time.
🧮 Matrix generation (jagged)
Each CSV row becomes an independent array
Supports languages that naturally use jagged structures
Output is formatted and ready to paste into code
🌐 Multi-language support
C# (jagged arrays T[][])
C (C90 / C99 / C11 jagged matrices)
JavaScript
Python
🧾 Header handling
Ignore first row as header (optional)
Ignore first column as header (optional)
📋 Copy to clipboard
One-click button to copy the generated code.
🔢 Type inference
Automatically detects integers, floating-point values, booleans and strings
Strings are properly quoted per language
Demo
Usage
Open a .csv file
Run “Run converter csv to an array”
Edit the data in the grid if needed
Select language and version
Click Apply and copy the generated code
📌 Example
CSV Input
1,2,3
4,5,6
7,8,9
Generated C# matrix (old syntax)
int[][] matrix =
{
new int[] { 1, 2, 3 },
new int[] { 4, 5, 6 },
new int[] { 7, 8, 9 }
};