Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>CSV to ArrayNew to Visual Studio Code? Get it now.
CSV to Array

CSV to Array

jesusnoel

|
88 installs
| (0) | Free
Convert CSV files into C/C# arrays using an interactive table editor.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

csv-to-array

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

csv-to-array demo

Usage

  1. Open a .csv file
  2. Run “Run converter csv to an array”
  3. Edit the data in the grid if needed
  4. Select language and version
  5. 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 } };

Generated C# matrix (collection syntax)

int[][] matrix = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ];

Generated C matrix (C90 style)

int r0[] = { 1, 2, 3 }; int r1[] = { 4, 5, 6 }; int r2[] = { 7, 8, 9 }; int* matrix[] = { r0, r1, r2 };

Generated C matrix (C99 style)

int** matrix = malloc(3 * sizeof *matrix); for (int i = 0; i < 3; i++){ matrix[i] = malloc(3 * sizeof *matrix[i]); } matrix[0][0] =1; matrix[0][1] =2; matrix[0][2] =3; matrix[1][0] =4; matrix[1][1] =5; matrix[1][2] =6; matrix[2][0] =7; matrix[2][1] =8; matrix[2][2] =9; //use matrix before free for (int i = 0; i < 3; i++) free(matrix[i]); free(matrix);

Generated C matrix (C11 style)

// C version: 11 size_t rows = 3; int** matrix = calloc(rows, sizeof *matrix); for (size_t i = 0; i < rows; i++){ matrix[i] = calloc(rows, sizeof *matrix[i]); } matrix[0][0] =1; matrix[0][1] =2; matrix[0][2] =3; matrix[1][0] =4; matrix[1][1] =5; matrix[1][2] =6; matrix[2][0] =7; matrix[2][1] =8; matrix[2][2] =9; //use matrix before free for (int i = 0; i < 3; i++) free(matrix[i]); free(matrix);

Generated JavaScript matrix (ES6/ES2015 or higher)

const matrix = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ], ];

Generated Python matrix (2. or higher)

matrix = [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ], ]

📦 Requirements

  • Visual Studio Code 1.xx.x or later
  • No external dependencies required

🐞 Known Issues

  • Large CSVs may take longer to render.
  • Mixed data types may require manual cleanup.
  • Speially characters for strings is not supported yet.

📝 Release Notes

0.0.1

  • Initial release of csv-to-array
  • CSV grid editor (Webview)
  • Add/remove rows and columns
  • Generate C# 2D array and 1D vector
  • Copy generated array to clipboard

0.0.2

  • Switched C# output from multidimensional arrays (T[,]) to jagged arrays (T[][])
  • Removed 1D vector generation
  • Cleaner and more idiomatic C# output
  • Improved compatibility with real-world C# codebases

0.0.5

  • Added C language support with jagged matrix generation
    • C90: static row arrays with pointer matrix
    • C99: dynamic allocation using malloc
    • C11: dynamic allocation using calloc
  • Unified matrix generation using jagged structures across languages
  • Improved type inference for C and C#
  • Added language/version selector to code generation
  • Updated README with detailed multi-language examples

0.0.6

  • Added JavaScript language support
  • Added language/version selector to code generation
  • Updated README with examples for JavaScript

0.0.7

  • Added Python language support
  • Added language/version selector to code generation
  • Updated README with examples for Python

0.0.8

  • Added Delete rows and columns support
  • Added edit mode

💡 Why jagged arrays?

Jagged arrays (T[][]) are more flexible, easier to manipulate, and more commonly used in modern C# codebases than multidimensional arrays (T[,]).


🤝 Contributing

Contributions are welcome!

Feel free to open issues, suggest enhancements, or submit pull requests.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft