Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Align CSV columns in PyCharm

Is there a way to view CSV in PyCharm with its columns automatically aligned?

For exemple this:

enter image description here

instead of this:

enter image description here

I know there's the 'Table Editor' option, but it leaves too much space between lines, it doesn't align numbers to the right and it doesn't let you zoom in the font:

enter image description here

like image 755
Raphael Avatar asked Sep 05 '25 14:09

Raphael


1 Answers

Your PyCharm is using the CSV-Plugin (CSV Plugin at JetBrains Marketplace to provide the text and Table Editor functionalities. The project page can be found at GitHub: SeeSharpSoft / intellij-csv-validator.

The Settings for this Plugin can be changed inside your PyCharm IDE Settings (File>Settings>Editor>Code Style>CSV/TSV/PSV).

To format my CSV files inside the Text Editor, I'm using f.e. those settings:

CSV Settings

The idea to format text based files could be very helpful - so far I found three different Python modules which could be used to achieve that:

  • Scolp

  • Tabulate

  • Columnar

Additionally you can take a look into this Pycharm Plugin String Manipulation. It solves your requirement inside the Text Editor:

Available Options to align Columns

like image 132
squeezer44 Avatar answered Sep 09 '25 00:09

squeezer44