How to view column-aligned CSV files in Visual Studio editor
Asked Answered
K

2

30

Opening a .csv file in Visual Studio produces an unreadable jumbled mess. Is there any way to set up Visual Studio to automatically format these files in columns (a "grid-view", so to speak) so I can edit them directly in the IDE? Are there any tricks or workarounds or extensions that could make these files more easily readable?

(VSCode has what looks to be a fantastic extension for this sort of thing, but alas, it won't work in Visual Studio Pro/Enterprise. Also, BeyondCompare4 does this automatically, and Notepad++ has the TextFX plugin which supports this as well. Has no one ever produced such a plugin for VS?)

(UPDATE: I have created a feature request here. Please vote for it if you upvote this ticket.)

Kernite answered 10/5, 2018 at 13:29 Comment(3)
Two VS extensions:marketplace.visualstudio.com/… and marketplace.visualstudio.com/…, maybe it was helpful for you, if it was not the real extension you want to get, you could submit a feature request to the product team directly:visualstudio.uservoice.com/forums/121579-visual-studio.Deception
Neither of those first two links provide the functionality described in my post. Submitting a feature request, however, is a great idea. I will update my ticket with a reference to the request when I create it.Kernite
It would be nice to easily right click 'open in excel'. Can you configure vs code to open certain file types with certain programs?Wallpaper
W
28

You can install csv-viewer extensions by searching for them in the search tool in the VSCode "Extensions" menu.

Some good ones are 'Excel Viewer' by GrapeCity, or 'Edit csv' by janisdd.

Both of these (and many more) allow you to view excel files in columns inside VScode, not just text files as is default.

Wallpaper answered 3/2, 2020 at 23:17 Comment(5)
Unfortunately, as I mentioned in my post, the VSCode extensions don't work in VS Pro. :(Kernite
Oh, sorry :( I came back at a later date to answer this and didn't remember you said VS Pro. Hopefully people who are looking for this (who don't have VS pro) can be helped. If not, I can delete the answer.Wallpaper
With VSCode "Excel Viewer" works nice with csv files. (If you have tab-delimited file, extension should be .tsv for the 'Excel Viewer' correctly assume delimiter).Justice
I've used that for weeks let me tell you. it's not good. you cant search the data properly. and it's risky if u didn't aware of itWitcher
I prefer "Edit csv" since I can edit. Also the interface uses larger fonts and borders, making it more usable (at least for me).Wurtz
B
2

The previous answers are for Visual Studio Code, not for Visual Studio. After this question was asked, there is now an extension named Preview-CSV for Visual Studio that generally does what the question is asking for. It relies on having the MetaOutput extension also installed.

It doesn't let you edit them directly, but does format them for reading nicely in columns. To edit, it has a button to take you to that line in the text file, so it does still help with editing, in a way.

Bender answered 14/10, 2023 at 12:13 Comment(1)
Good point. Upvoted. I have deleted my answer.Frangos

© 2022 - 2024 — McMap. All rights reserved.