How to view column-aligned CSV files in Visual Studio editor - csv

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.)

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.

Without extension, VSCode 1.44 (March 2020) might bring a native answer with:
Custom Text Editors
With custom text editors, extensions can now replace VS Code's standard editor with a custom webview based view for specific text based resources. Potential use case include:
Previewing assets, such as shaders or .obj files.
Creating WYSIWYG editors for markup languages such as XAML.
Providing alternative, interactive views of data files such as json or csv.
The custom editors documentation covers how to use the new custom text editor API and how to make sure your new editor works well with VS Code. Also be sure to check out the custom editors extension sample.
And that comes with:
workbench.editorAssociations setting
Also for custom editor, the new workbench.editorAssociations setting lets you configure which editor is used for a specific resource.
The example below configures all files ending in .catScratch to open using the example custom text editor from our extension samples.
"workbench.editorAssociations": [
{
"viewType": "catCustoms.catScratch",
"filenamePattern": "*.catScratch"
}
]
And:
View: Reopen with
The new View: Reopen with command lets you reopen the currently active file using a different custom editor.
You can use this command to switch between VS Code's standard text editor and the custom editor, or to switch between multiple custom editors for a resource.

Related

How to format pasted JSON in IntelliJ / Android Studio

I often need to use a text editor while writing code to paste random notes but especially JSON responses, where I format them using a plugin (for Sublime).
I recently heard about the 'scratch file' feature in IntelliJ / Android Studio which does exactly what I need it to - except I can't make it format JSON I paste in nicely.
How can I make Android Studio format JSON in a scratch buffer file?
I highlight the code and run Command Option L (a short-cut for the Code->Reformat Code menu).
On Windows use Ctrl Alt L.
Note that this only works if the code is well-formed JSON (clear any red squiggles).
You are asking about two seperate things: scratch files and scratch buffers.
When you create a scratch file in IntelliJ you can choose the type of the file (e.g. JSON) that you want to create. Based on file's type, IntelliJ provides code formatting (use Code->Reformat code).
However, scratch buffers are just simple .txt files and the only formatting that can be used is the one associated to .txt format. So, if you put JSON into scratch buffer it won't get formatted with JSON type formatter.
I would encourage you to use scratch files instead of scratch buffers if you want JSON formatting.
More information can be found at IntelliJ's official page https://www.jetbrains.com/help/idea/2016.2/scratches.html.
choose from the menu : code -> reformat code
hotkey On Windows -:
CTRL + Alt + L
Important note- if you have sensitive information in your JSON- NEVER use online tools to parse or beautify it. because this will compromise your organization's and customer's information
If you run the latest version I'd create a new Scratch File of type JSON.
It's really easy, e.g. hit double shift, then search for new scratch file, select JSON as the language, paste your snippet and then use the shortcut that you usually use for formatting any file in intelliJ.
There is a plugin Save Actions that does auto-formatting (also of JSON) every time when I save the file:
select Android Studio > Preferences > Plugins
check Martketplace tab and search for Save Actions (it has a red square-ish icon) and press Install next to it.
At this point you will need to restart your android studio, and then you can enable "Reformat on save" by:
select Android Studio > Preferences > Other Settings > Save actions, in there, select:
✅ General > activate save actions on save
✅ Formatting actions > Reformat File

ExtendScript plugin for Webstorm or PhPstorm?

when scripting for after effects I often use ExtendScript.
There is an extendscript package available for sublime text out there.
https://sublime.wbond.net/packages/ExtendScript
(this makes it possible to run your script directly from sublime text into after effects)
I was wondering if there is also something like this out there for any JetBrains IDEs (like WebStorm or PhpStorm etc.). I do know it has several plugins in it, but i don't know if there was ever one made for Expendscript like the one for sublime text.
I'm not aware of any... Please see http://devnet.jetbrains.com/message/5496889#5496889 for some hints
To be able to run adobe scripts from WebStorm, you can use external tools (Settings/External tools):
create a new external tool
specify a full path to Adobe tool capable of executing .jsx ("C:\Program Files (x86)\Adobe\Adobe Photoshop CS5\Photoshop.exe", for example) as a 'Program'
add $FileName$ as parameters
set a working directory to $FileDir$
make sure to check Show in/Project views and Editor menu to be able to run your tool from file right-click menu in Project view/Editor
then you'll be able to run your tool from a right-click menu of your .jsx file - the file will be passed to Photoshop as an argument

How do I get the template editor for Eclipse scala SKD?

I am trying to get started developing with the Eclipse Scala SDK with the Play Framework. But when I try to select an editor with which to open my views (*.scala.html), there is no option that I can find that will (a) open the file correctly and (b) use syntax highlighting. Right now I am just using the text editor option. I read on this thread that the correct editor is the Template editor, but I cannot find that editor and I don't know how to get new editors. I have tried Preferences > General > Editors > File Associations, but the template editor is not an option.

Simple WYSIWYG HTML editpart for eclipse rcp?

I am looking for a Eclipse plugin which I could use to provide a WYSIWYG HTML editor in an Eclipse RCP application.
I need nothing fancy, something with similar functionality to the editor I am using to type this question would be sufficient.
Based on the answers to What is the best HTML editor for Eclipse? there should be one provided by the Web Tools Platform project: Web Page Editor. But I could not figure out its class name to use it inside a View.
A small code example on using it would be especially helpful.
Quick tutorial:
In eclipise:
-import project from cvs, host: dev.eclipse.org, repository path:/cvsroot/webtools, user:anonymous, connection type:pserver
-click next, find and choose plugin org.eclipse.jst.pagedesigner and import it to your workspace
-create Hello RCP
-in plugin.xml tab extension add new: org.eclipse.ui.editor
-in this extension point add new element, editor and set: id- no matter what, but remember it for future (e.g. "editorId"), extensions: xml,html,xhtml class:org.eclipse.jst.pagedesigner.editors.HTMLEditor, contributorClass: org.eclipse.jst.pagedesigner.editors.actions.PageDesignerActionBarContributor2, default: false.
-Now you have to open a file, "transform" to IEditorInput
-call method IWorkbenchPage.openEditor(iEditorInput,"editorId")
Should work!

How to edit preference file for Notepad++?

My open source project uses spaces, not tabs, in its code.
A contributor to the project has his own website which uses tabs, not spaces.
He uses Notepad++ in Windows to edit files for both projects, and is frustrated when he forgets to manually set the Preferences correctly and thus inserts tabs into my project's files.
Is there a way to edit this Preference via a script? That way he could click one icon to start Notepad++ in mode 1 (running a batch script to modify the Preferences file and then start the program) or click another to start in mode 2.
Or if there's any other way to make him not have to remember this chore, that would work too. Maybe having a Preferences setting that depends on what folder the edited file is inside of?
Any help would be appreciated. Thanks!
The notepad++ setting for replacing tabs with spaces is stored in following xml file
%USERPROFILE%\Application Data\Notepad++\config.xml
The following is the line that needs to be changed
<GUIConfig name="TabSetting" size="4" replaceBySpace="yes" />
Now I don't know how we can edit a file by batch script in windows, but if it is not possible, then he can keep two config files config-tabs.xml and config-spaces.xml. And in the script you can copy appropriate file depending on what he needs to work on.