Hongmu Notes

JSON array field processing

To put multiple items in one cell, the key is to choose the right connection method.
100% Browser local processing 0 Data upload

🧾 Paste JSON and convert to table immediately

Number of columns 0 | Number of lines 0

💡 Instructions for use

  • Most suitable for object arrays: each item is a record, and the table is neatest when the field structure is consistent; when the top level is an object, it is processed as a single row.
  • Nested fields will be flattened level by level, and column names are spliced by field names at each level plus delimiters, such as superior_subordinate, based on which the original structure can be inferred.
  • The columns are arranged in the order in which the fields first appear, and the rows are arranged in the original order of the array, so the results can be compared with the source data one by one.
  • When the field content contains commas or line breaks, the export will be escaped. If the columns in the spreadsheet software are not aligned, it is probably a delimiter conflict, and tab characters can be used instead.

To put multiple items in one cell, the key is to choose the right connection method.

How to deal with default

Multiple items concatenated in one cell using delimiters

Keep each record on its own line

Do not change the original number of records

How to choose separator

Select characters that do not appear in the content

Commas are commonly used in tag content but are prone to conflicts

A vertical bar or semicolon is usually safer

When should we break up the bank?

When statistics or filtering by individual items are required

When the single item itself also needs to participate in the sorting

When the number of items is small and the structure is regular

The cost of breaking the bank

One record becomes multiple lines

Direct counting will overcount the number of records

It is necessary to remove duplicates according to the unique identifier before counting.

The trade-off between two methods

The connection method is more stable and the number of rows will not expand.

The rows are broken down into more details to facilitate item-by-item analysis.

Choose according to subsequent use, no need to insist on uniformity

After splitting the rows, remove duplicates according to the unique identifier and then count, otherwise the number of records will be counted too much.

📖 Glossary

object array
It looks like it is wrapped in square brackets and each item inside is the same structure. It is the most common data form for converting to a table. Each item corresponds to a row of the table, and the field name corresponds to the column name.
Key name
The field name in the object becomes the header of the table after conversion. When key names are inconsistent between different items, the missing positions will be left blank instead of misaligned.
Nested objects
The value of the field itself is an object. It cannot be placed directly into the cell, it needs to be expanded into multiple columns, and each level is connected with a separator, for example, naming the new column in the form of "superior_subordinate".
flatten
Compress the nested structure into a field set with only one layer, so that each column corresponds to a specific value. Information is not lost after flattening, but the number of columns will increase significantly.
header order
The order in which the columns are sorted. A common practice is to determine the fields in the order they first appear. This is both stable and easy to compare with the original data, and will not change repeatedly due to the increase in data volume.
Array field
The value is a field of a list, such as a collection of tags. When converting, multiple items are usually connected into one cell using delimiters, or a separate column is generated for each item.
Null value handling
How an item is rendered if this field is missing. A common practice is to leave it blank instead of filling in zeros or writing "none", because leaving it blank can distinguish between "no such field" and "value is zero".
type mix
The value types of the same field in different items are inconsistent, for example, one item is a number and another item is a text. When converting, it should be processed uniformly as text to avoid numbers being truncated or having extra quotation marks in front of them.
Delimiter selection
Character used when concatenating nested field names and array items. Characters that should not appear in the selected content, otherwise it will be difficult to determine where the separation position is afterwards.
CSV export
Save table results as comma-delimited text format, which can be opened directly with spreadsheet software. When the field content contains commas or newlines, it needs to be wrapped in quotation marks, otherwise it will be split into multiple columns.
escape
Handles delimiters, quotes, or newlines in field content. Incomplete escaping will cause column misalignment and is the most common cause of column misalignment after export.
Large file processing
Issues that need to be taken into consideration when the amount of data is large. Too many fields will produce a large number of columns, and too deep nesting of fields will make column names verbose. If necessary, the fields should be streamlined before conversion.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

Will the data be uploaded??
No. All parsing and exporting are completed locally in the browser, and no upload request is initiated.
Is nested JSON supported??
Support. Nested fields will be flattened into multiple columns level by level, and the column names are spliced ​​together from the field names at each level.
What to do if the JSON format is wrong?
The page will prompt that parsing failed. Please check whether the brackets, quotation marks, and commas are paired completely.
What format can it be exported to??
You can copy it into comma-delimited text and paste it directly into the spreadsheet software for use.
How to display array fields?
By default, delimiters are used to connect multiple items in one cell, and they can be split separately if necessary.
How is the order of columns determined??
Arrange the fields in the order they first appear to ensure stable results and facilitate column-by-column comparison with the source data.