Unable to save a file as JSON? - json

Am in the need of creating a file with a extension of JSON(Json file). But I'm unable to create. When I try save a file with json extension like file name followed by a .JSON it is takes as,
filename.JSON.txt
How to solve this?? Am using windows 7(32 bit) OS. Please suggest something ???

When you Save As..., make sure the "Save as type" dropdown contains "All Files" and not "Text Documents(*.txt)". That way it won't add the extension '.txt' but the extension you add.

You have to delate the extension .txt to get a JSON file.

I also struggled with this, but in the end it was quite simple...
In the TextEdit menu, go to "Format" and choose "Make Plain Text".
Then, save the file and write the filename with the .json extension. Pop-up dialogue will ask if you want to save with .json or .txt, just choose .json to confirm!

Related

How to open a database file with no file type in SSMS?

I have a database file with no file type, I need to open it in SSMS first. When I try to open it, it says no editor for it. I tried to open it in a text editor by changing its name with a txt extension, it displayed unreadable code on the whole page. I have searched online it seems the only way is to change the file name with an extension. Is there any way to make SSMS recognize the generic extension file? Thanks
Larnu corrected me to use "Restore" instead of "Open". Thanks
New to database, need to learn everything.

Why is my PHP file class recognized as text file?

I'm working on a Laravel project and when I was creating a new file I miss spelled the php extension ("php") but I didn't notice until I clicked enter so my PHP class files now appear as text files in PhpStorm and appears no hints whenever I write something in any php file.
Im using PhpStorm 2020.2.
Settings (Preferences on macOS) | Editor | File Types
Locate "PHP" entry in the top list (Recognized File Types)
Ensure that the middle list (File Name Patterns) has *.php entry there.
If it's not there then add it. Looks like you somehow re-assigned it to the "Text" file type.
Altought blade.php get recognized right,
That's because *.blade.php is assigned to separate/dedicated "Blade" file type (so IDE can provide Blade-specific support there).
And if you already did as #LazyOne suggested and your file still showing as text then right click the file and do this:

Convert .json to ipynb

I am taking a course that uses ipython notebook. When I try to download the notebook (through File -> Download as -> ipython notebook), I get a file that ends with ".ipynb.json". It doesn't open as an ipython notebook but as a .json file so something like this:
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"---\n",
"\n",
"_You are currently looking at **version 1.1** of this notebook. To download notebooks and datafiles, as well as get help on Jupyter notebooks in the Coursera platform, visit the [Jupyter Notebook FAQ](https://www.coursera.org/learn/python-data-analysis/resources/0dhYG) course resource._\n",
"\n",
"---"
]
},
...
}
I've tried deleting the ".json" in the file name and it doesn't work. How can I convert this file back to something that can be opened and run as an ipython notebook? Thank you very much!
My Solution: just remove the filename extension .json. for example, change myfile.ipynb.json to myfile.ipynb. Then, you can open it by a click in jupyter notebook !
I have encounter the same problem as you did. I found a link that describe what ipynb exactly is. see here http://ipython.org/ipython-doc/rel-1.0.0/interactive/nbconvert.html. It says ipynb file is actually json file. Hope this
On the Mac you could go and
Right click on the filename.ipynb.json
Click on Get Info from the list.
From the Get Info window, find the section Name&Extension remove the extension/suffix .json from the file name.
Hope that helps!
Are you trying download this from Github? Especially on Google Chrome browsers, I've had issues download .ipynb files using right click > Save link as... I'm not sure if other browsers have this issue (Microsoft Edge, Mozilla Firefox, Safari, etc.).
This causes issues since when downloading, it doesn't completely download the file usually and it becomes corrupted so you can't download an IPython notebook that may run properly. One trick when trying to download .ipynb files on Github is to click it, click Raw, then copy everything (Ctrl + A) and paste it into a blank file (using text editors such as Notepad, Notepad++, Vim, etc.) and save it as "whatever_file_name_you_choose.ipynb". Then you should be able to properly run this file, assuming a non-corrupted file was uploaded to Github.
A lot of people with very large, complicated IPython notebooks on Github will inevitably run into this issue when simply trying to download with Save link as.... Hopefully this helps!
I opened it as/with nbviewer and then selected it all and saved it as a "txt" file that I then opened in Notepad++. I then resaved it as a file with the extension ipynb and opened it in my jupyter notebook ok.
The easy thing to do is to copy the JSON contents into a notepad and save it again with .ipynb extension
Just remove the .json file extension leaving the .ipynb one, as pointed out by the following related post: https://superuser.com/questions/1497243/why-cant-i-save-a-jupyter-notebook-as-a-ipynb. As #jackie already said, you should consider them as .json files meant only to be edited by the IPython Notebook app itself, not for hand-editing.
Use a simple trick. Let that file get downloaded automatically. Re-download it again then it will prompt you to download and replace that file. At that time, you save that by replacing .json to .ipynb
After downloading the file with ipynb.json, Take the following steps:
Go your terminal/command line window
Navigate to the directory where your file is
Type:
windows OS: rename yourfile.ipynb.json to yourfile.ipynb
Unix/Linux: mv yourfile.ipynb.json to yourfile.ipynb
This work perfectly for me.
i tried this method and it worked. Just copy, paste it in notepad and save as "file_name.ipynb". hope this works for you too.

How can I reformat Source Code for files without file extension in WebStorm 2016.1.3?

How can I reformat Source Code for files without file extension in WebStorm 2016.1.3 ?
Example: I've a automated_generated_json_file_without_extension in one line and the name of the files are always different. I don't want to configure all these file names in "File Types" Dialog and register new patterns.
In Sublime you can change the file type at the right bottom corner, is there a similar function in WebStorm?
Unfortunately you cannot change file type of the file on the fly in WebStorm.
Possible workarounds:
Have a set of files (e.g. test.json, test.js etc) somewhere in a project where you can copy-paste this file content, reformat it there and copy it back.
Use "Scratch files" functionality (Tools | New Scratch File...) and then the same copy-paste content to reformat.

Converting from .asm to .s file (Windows/Intel)

For my homework, I had to write a MIPS program. I'm on windows/intel machine and used notepad++ to write it, which doesn't have the functionality to save the file using a .s extension. Is there any way to save the file as a .s using windows?
On the Save As dialog, switch the "Save as type:" drop-down from "Text Documents (*.txt)" to "All Documents (*.*)" and type the full name of your file (e.g. "myfile.s").