Skip to content

Conversation

@benny123tw
Copy link

Try resolves #1144

Changes:

  • Introduce a new CsvConverter for converting CSV files into Markdown tables.
  • Register CsvConverter in MarkItDown’s converter initialization in _markitdown.py.
  • Update converters/init.py to export CsvConverter.
  • Add _csv_converter.py to implement CSV conversion using pandas.
  • Revise test vectors to expect the Markdown table format produced by CsvConverter.

This change enables CSV file support in MarkItDown while keeping existing features intact.

- Introduce a new CsvConverter for converting CSV files into Markdown tables.
- Register CsvConverter in MarkItDown’s converter initialization in _markitdown.py.
- Update converters/__init__.py to export CsvConverter.
- Add _csv_converter.py to implement CSV conversion using pandas and openpyxl.
- Revise test vectors to expect the Markdown table format produced by CsvConverter.
- Adjust test_cli_vectors header for proper encoding handling.

This change enables CSV file support in MarkItDown while keeping existing features intact.
@benny123tw
Copy link
Author

@microsoft-github-policy-service agree

afourney pushed a commit that referenced this pull request Apr 13, 2025
* feat: Add CSV to Markdown table converter

- Add new CsvConverter class to convert CSV files to Markdown tables\n- Support text/csv and application/csv MIME types\n- Preserve table structure with headers and data rows\n- Handle edge cases like empty cells and mismatched columns\n- Fix Azure Document Intelligence dependency handling\n- Register CsvConverter in MarkItDown class

----

Thanks also to @benny123tw who submitted a very similar PR in #1171
@benny123tw
Copy link
Author

Close this PR, please refer to #1176

@benny123tw benny123tw closed this Apr 14, 2025
@benny123tw benny123tw deleted the feat/support-csv-converter branch April 14, 2025 02:01
azhao25 pushed a commit to azhao25/markitdown that referenced this pull request Oct 16, 2025
…t#1176)

* feat: Add CSV to Markdown table converter

- Add new CsvConverter class to convert CSV files to Markdown tables\n- Support text/csv and application/csv MIME types\n- Preserve table structure with headers and data rows\n- Handle edge cases like empty cells and mismatched columns\n- Fix Azure Document Intelligence dependency handling\n- Register CsvConverter in MarkItDown class

----

Thanks also to @benny123tw who submitted a very similar PR in microsoft#1171
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fail to convert CSV table

1 participant