Hongmu Notes

TSV tab conversion

The data copied from spreadsheet software is mostly tab-delimited.
100% Browser local processing 0 Data upload

🔄 Source data and conversion settings

identified as - | Number of lines 0 | Number of columns 0 | The number of columns is the same -

💡 Instructions for use

  • After pasting, check the recognition results first: if the separator is correct, the number of columns will be stable, but if the delimiter is incorrect, the first row will look obviously wrong.
  • When the field contains commas, use tab delimiters instead, or wrap the entire field in quotation marks, both of which can prevent the structure from being cut incorrectly.
  • After checking the header, the number of records should be one less than the total number of rows; if they are equal, it means that the header is regarded as data and needs to be reset.
  • Numbers starting with zero will be inferred as numbers and the leading zeros will be discarded. You can preserve them by adding a prefix before transferring; rows with inconsistent column numbers need to be returned to the source for correction.

The data copied from spreadsheet software is mostly tab-delimited.

Applicable data

When the field content contains commas, use tab characters to save a lot of escaping.

Forms with more addresses, descriptions, and amounts often have this format.

Identification method

Turn on invisible character display in a plain text editor to confirm.

Tab-delimited data has neat tabs between columns.

FAQ

Editors often automatically replace tab characters with spaces, causing parsing to fail.

When the field itself contains tab characters, it must be wrapped in quotation marks.

Empty line cleaning

The copied data often contains blank lines at the beginning and end or in the middle.

Clear empty lines before transferring to avoid generating empty records.

format interchange

When converting to and from comma format, the quotes must be retained for fields containing delimiters.

Structured results are easy for programs to read and verify.

When parsing an exception, first confirm whether the delimiter is a tab character. Many editors will quietly replace it with a space.

📖 Glossary

CSV
Plain text table format with comma separated fields, one record per line. Its advantages are that it is versatile, small in size, and can be opened by any spreadsheet software; its disadvantage is that it lacks type information, all content is text, and you need to rely on convention to determine which column is a number or date.
TSV
Table format with tab-delimited fields, differing from the comma version only in the delimiter. When the field content itself contains commas (such as address, description text), using tab characters can save a lot of escaping, so data copied from spreadsheet software is often in this form.
delimiter
Character used to distinguish fields. It must not appear in the field content, otherwise the parsing result will be over-cut. A common practice is to choose based on the data content: use tabs if the content contains commas, replace with semicolons if the content contains tabs, and rely on quotation marks when it is unavoidable.
Quotation mark escaping
When delimiters or line breaks appear in the field content, use quotation marks to wrap the entire field, and the quotation marks themselves are repeated again. This is the key mechanism for text tables to express complex content, and must be observed on both sides of parsing and generation, otherwise explanatory text containing commas will definitely cut the table incorrectly.
Header
The first row is a header row that explains the meaning of each column. When converting to a structured format, the header is usually used as the field name; if the header is not checked, the program can only generate fields named by serial numbers, which is much less readable. The basis for judgment is whether the first line is text rather than data.
Field type
Whether the data in a column is numeric, Boolean, or text. The plain text format does not save type information, and inference is required when converting to a structured format: what looks like numbers is converted into numbers, and the rest remains text. Inference errors can cause subsequent calculations to treat numbers as text.
Arrays and Objects
There are two basic structures in structured formats: arrays represent a sequence of ordered values or records, and objects represent a set of key values with field names. A row of a table usually corresponds to an object, and the entire table corresponds to an object array. This is also the most natural correspondence between tables and structured formats.
Nested structure
The object contains objects or arrays. The table is two-dimensional and cannot directly express any depth of nesting. Therefore, during conversion, the nested part must be serialized into a piece of text or split into multiple tables. It is easier to figure out how to deal with this part before converting than to fix it after converting.
encoding
How characters are stored in the file. The same Chinese character is represented by different bytes in different encodings, and it will become garbled when opened with the wrong encoding. Text tables are especially prone to encounter this problem, because the default encoding exported by different software is not consistent, and the source should be confirmed before conversion.
column alignment
The number of fields in each row should be consistent. Inconsistent numbers usually mean that the delimiters in a field were not escaped correctly, causing that row to be over- or under-cut. Alignment check is the most effective format verification method and can detect problems before the data enters the subsequent process.
null value
There is no content in the field. It is represented differently in different formats: it is two consecutive delimiters in the table, and it may be an empty string in the structured format. When converting, you need to make it clear whether the null value should remain empty or be converted to a specific tag, otherwise the meaning will be changed.
Conversion check
After the conversion is completed, check whether the result is correct, including whether the number of rows is consistent, whether the columns are aligned, and whether special characters are destroyed. The easiest way is to convert the conversion result back to the original format and compare it with the original data; the two conversions can be restored, indicating that no information was lost in the process.

🔗 All keywords and tutorials

Keywords page of the tool12a

Return to tool home page

❓ FAQ

Will the data be uploaded??
No. All parsing and generation are completed locally in the browser, and no upload request is initiated.
What formats are supported?
Supports comma- and tab-delimited tabular text, as well as structured format conversion.
Will Chinese characters be garbled??
The page is uniformly processed in UTF-8; if the source file encoding is different, confirm it before pasting it in.
What to do if there are commas in the field?
Enclose the entire field in quotation marks, or use tab characters as delimiters instead.
Do I need to check the header??
If the first line is a text description, check it as the field name; if it is data itself, leave it unchecked.
Can I download the results??
Yes. After the conversion is completed, copy or download it into a file so that it can be put into other tools for further processing.