📜  JSON 和 CSV 之间的区别

📅  最后修改于: 2021-10-20 10:23:45             🧑  作者: Mango

JSON: JSON 指的是JavaScript Object Notation 。它是一种独立于语言、人类可读的语言,因其简单性而被广泛用于基于 Web 的应用程序中。 JSON 扩展名以 .json 结尾。 JSON 是 XML 的用户友好替代品,因为它轻量级且易于阅读。它支持数组和对象等数据结构以及在服务器上快速执行的 JSON 文档。

CSV: CSV 是指逗号分隔值。它将纯文本保存为以逗号 (, ) 分隔的一系列行(行)中的一系列值(单元格)。 CSV 文件实际上可以在文本编辑器中打开并阅读。有很多用于读取 CSV 文件的应用程序,并且许多语言都提供了简化读取/写入 CSV 格式的内置功能。这些文件主要由专业人士用于数据分析或可视化。

JSON 与 CSV

下面是 JSON 和 CSV 之间的差异表:

SR.NO JSON CSV
1. JSON stands for JavaScript Object Notation. CSV stands for Comma separated value.
2. It is used as the syntax for storing and exchanging the data. It is a plain text format with a series of values separated by commas.
3. JSON file saved with extension as .json. CSV file saved with extension as .csv.
4. It is more versatile. It is less versatile.
5. It is used for for key, value store and supports arrays, objects as values. It is a standard of saving tabular information into a delimited text file.
6. It mainly uses the JavaScript data types. It does not have any data types.
7. It is less secured.  It is more secured.
8. It consumes more memory as compared to CSV. It consumes less memory.
9. It support a lot of scalability in terms of adding and editing the content.  It does not support a lot in terms of scalability.
10. It is less compact as compared to CSV file . It is more compact than other file formats.