使用 Notepad++ 以 json 格式保存文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29232728/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 17:48:33  来源:igfitidea点击:

Save a file in json format using Notepad++

json

提问by Bil Bal

I have a json format (let's say text) in Notepad++.

我在 Notepad++ 中有一个 json 格式(比如说文本)。

I want to save it as a jsonfile using filename.json format.

我想json使用 filename.json 格式将其保存为文件。

How can I make it in Notepad++(because I can't find the extension when I go to save as option)

我怎样才能让它进来Notepad++(因为我在去另存为选项时找不到扩展名)

回答by yiabiten

You can save it as .txt and change it manually using a mouse click and your keyboard. OR, when saving the file:

您可以将其另存为 .txt 并使用鼠标单击和键盘手动更改它。或者,在保存文件时:

  • choose All types(*.*)in the Save as typefield.
  • type filename.json in File namefield
  • All types(*.*)Save as type字段中选择。
  • File name字段中输入 filename.json

回答by nom

enter image description hereSave the file as *.txtand then rename the file and change the file extension to json

在此处输入图片说明将文件另存为*.txt,然后重命名文件并将文件扩展名更改为json

回答by Sam

In Notepad++ on the Language menu you will find the menu item - 'J' and under this menu item chose the language - JSON.

在 Notepad++ 的语言菜单中,您会找到菜单项 - 'J',在此菜单项下选择语言 - JSON。

Once you select the JSON language then you won't have to worry about how to save it. When you save it it will by default save it as .JSON file, you have to just select the location of the file.

一旦您选择了 JSON 语言,您就不必担心如何保存它。当您保存它时,它默认将其保存为 .JSON 文件,您只需选择文件的位置。

Thanks, -Sam

谢谢,-山姆

Please look at the pic, it will give you a better idea..

请看图,它会给你一个更好的主意..

回答by kamikater

If you want to save to a specific filename just ignore the provided extensions in Notepad/Word/whatever. Just set the filename.ext in " " and you're done. "Save as type" will be ignored.

如果您想保存为特定文件名,只需忽略记事本/Word/任何内容中提供的扩展名。只需在“”中设置 filename.ext 就完成了。“另存为类型”将被忽略。

enter image description here

在此处输入图片说明

回答by Mohamed Shaaban

Just show file name extension from Windows Explorer, after applying the below steps, create a new file, and type your extension as .json

只需从 Windows 资源管理器中显示文件扩展名,在应用以下步骤后,创建一个新文件,然后键入您的扩展名 .json

Open Folder Options by clicking the Start button Picture of the Start button, clicking Control Panel, clicking Appearance and Personalization, and then clicking Folder Options.

通过依次单击“开始”按钮“开始”按钮图片、“控制面板”、“外观和个性化”,然后单击“文件夹选项”,打开文件夹选项。

Click the View tab, and then, under Advanced settings, clear the Hide extensions for known file types check box, and then click OK

单击“查看”选项卡,然后在“高级设置”下清除“隐藏已知文件类型的扩展名”复选框,然后单击“确定”

Reference

参考

回答by Bharti Rawat

Simply you can save with extension .jsonbut while saving you have to do some changes.

简单地您可以使用扩展名.json进行保存,但在保存时您必须进行一些更改。

Change Save as typein red circle in image to All Files.

图像中红色圆圈中的Save as type更改All Files

It will create .json file with name bharti.json.

它将创建名为bharti.json 的 .json文件。

To check this --> Right click at file--> Properties--> Type of file: JSON File (.json)

要检查这个 -->右键单击文件-->属性-->文件类型:JSON 文件 (.json)

enter image description here

在此处输入图片说明

回答by Nicollas

You can do using a simple notepad and save as FILENAME.json

您可以使用简单的记事本并另存为 FILENAME.json

That's all.

就这样。