Notes › Tech Notes › Splitting And Merging 20 Samples Back: Only 11 Restore The Original Byte For Byte

Splitting And Merging 20 Samples Back: Only 11 Restore The Original Byte For Byte

The delimiter dropdown holds only 5 fixed options: consecutive commas leave empty fields instead of collapsing, the tab value is 2 literal characters, and only code point 32 splits. Each line sets its own column count, and just 11 of 20 samples come back byte for byte.

The run that did not add up

A comma-separated list at hand: 55 lines went in, and the page reported 50/50. a,,b split into 3 fields with the empty middle field kept exactly as it was; another dataset carried a backslash followed by a lowercase t, and even though the tab option was clearly selected in the dropdown, nothing was cut at all. Those three things show that this page keeps its own rules for what counts as a delimiter, for columns per line, and for what counts as a line, so intuition borrowed from a spreadsheet program does not transfer.

To keep intuition out of it, I loaded the script section of this template into Node unchanged and called the page's own functions to reproduce each result. One boundary first: the delimiter dropdown offers only 5 fixed options, there is no free-form delimiter box on the input side, and the phrase about a custom delimiter in the list copy belongs to the joiner on the merge side. Every number below comes from this Text Column Split And Merge page.

Consecutive delimiters: empty fields appear, nothing collapses

The comma option is an exact single-character match. The sample with code points 97 44 44 98 splits into 3 fields, the second one empty, and not a single field was collapsed; add one more comma and you get 4 fields; a trailing comma also leaves an empty field. What does trip people up is the space: a, ,b likewise splits into 3 fields, but the in-field trim turns that space into an empty field, so the result returns to a,,b; of the 4 fields in a, , ,b, 2 end up empty. The field count is honest, yet the contents have been washed once.

The tab option holds 2 literal characters as its value

In the dropdown, the value of the Tab option is, in the template source, a backslash plus the letter t: code points 92 116, length 2, not a real tab at code point 9. The page runs it through getSep to reach code point 9 before cutting, so a sample carrying a genuine tab does split, and three columns become three fields; a sample that itself contains the two characters backslash and t, code points 97 92 116 98, comes back unchanged, never cut. The same string in the merge-side joiner box is blunter: output code points 92 116 92 116 120, the two literal characters joined as ordinary characters, because that path never passes through translation.

Three space code points, only code point 32 counts

The space option is not the whitespace class of a regular expression. Replace the middle character of one and the same three-character sample, one at a time: code point 32 splits into 2 fields, both sides clean; switch to U+00A0 (code point 160, the no-break space) and the output code-point string is identical to the input, the whole line still 1 field; switch to U+3000 (code point 12288, the ideographic space) and it is still 1 field. Those last two arrive most often from a web page, a document or a chat window: they look like a space, and this page does not accept them. A width note: U+00A0 takes 2 bytes in UTF-8 and U+3000 takes 3 bytes, so failing to split does not mean they occupy nothing.

The space option only matches 32 U+0020 code 32 Cut, 2 fields U+00A0 code 160 Kept, 1 field U+3000 code 12288 Kept, 1 field Output code points for the last two are unchanged

Figure 1: how the three space-like code points behave under the same single option, and only 32 is cut

Each line sets its own column count; padding happens only in merge

Four ragged lines whose field counts are 3, 2, 4, 1 go through the split once, and the output still reports 3, 2, 4, 1 fields per line: short lines are not padded, long lines are not truncated, and a header line joins the count as ordinary data. Reversed, padding is something only merge mode does: list A holds 2 lines, list B holds 4, the output is 4 lines, and the shorter side receives empty strings. The two modes answer column parity in opposite directions, so read the mode before reconciling. If the trouble is in lines rather than columns, deleting characters or adding prefixes belongs to the Text Line Operations line of pages, which sits outside the scope of these measurements.

Split then merge back: only 11 of 20 samples restore the original

Take a sample, split it, merge it back, and compare byte by byte against the original: out of 20 samples, 11 are identical and 9 differ. All 9 that differ carry spaces, blank lines or a trailing newline: the first are erased by in-field trim, the last are eaten before counting even starts. Once the output joiner is changed to a 3-character dash, only 4 of the same 20 samples stay identical. The two-column path gets its own account: of the 10 samples that travel split and then merge, 7 are byte-identical and 3 differ; a three-column sample merged on two columns necessarily loses the third column, so 张三,25,北京 comes back as 张三,25, short by 7 bytes. Spreading two columns over every combination is another page's business, and Two Columns Into Every Combination keeps that ledger, so it is not repeated here.

Round-trip account for 20 samples Same joiner round trip: 11 identical Same joiner: 9 different 3-char dash joiner: 4 identical 10 samples: 7 same 3 differ Unequal ones all carry spaces, blanks or a newline

Figure 2: how many of the same batch of 20 samples survive under two output joiners, plus the 10 samples of the two-column path

Lines and bytes: blank lines are gone before counting

50 data lines with one blank line inserted every 10 lines gives 55 physical lines, and the statistic still reads 50/50, because blank lines are dropped during the filter stage rather than miscounted. A line holding a single comma counts as 1 line and outputs 1 line. When the input is nothing but 3 spaces or 3 newlines, the output box and the statistics line clear together, with no notice anywhere on the page, which reads as swallowed data. The batch account: the 50-line sample takes 990 bytes in and gives 990 bytes back; the 100-line sample takes 1991 bytes in and gives 1991 bytes back; deleting the last column from every 5 lines of the same sample, at 50 lines the output field-count distribution is 2 columns in 10 lines and 3 columns in 40 lines; and in a batch that is never split, the set of per-line field counts holds only the value 3.

Newlines pasted out of a Windows program are eaten the same way: the input ends with code points 13 10, the result joins the two segments with two newlines, the statistic reads 2/2, and neither control character survives at the line end. Before comparing the output on the way back, check the newline style of your own data.

One further reassurance: fields remain plain text throughout, with no numeric coercion. 007,1.50,1e3,12345678901234567890,0.1,00 comes out byte-for-byte equal to what went in, and a value such as 9007199254740993, beyond the safe integer range, is kept as written, leading and trailing zeros included.

The rules at a glance

QuestionHow this page answersMeasured sample
Do consecutive commas collapseThey do not, empty fields staycode points 97 44 44 98 → 3 fields
A space inside a fieldtrimmed into an empty fielda, ,b → a,,b
The tab optionvalue is 2 literal characters, active only after translationcode points 92 116 → code point 9
The ideographic spacenot treated as a space, whole line stays 1 fieldcode point 12288
Column countset by each line, no padding, no truncationlines of 3, 2, 4, 1 → 3, 2, 4, 1
Round-trip fidelitysamples with spaces, blank lines or a trailing newline differ20 samples, 11 same, 9 different
Blank lineseaten before counting55 physical lines → 50/50

Q: Are quoted fields preserved?

Quoted input was not measured this round, so nothing is promised about it. Every conclusion above covers only the 5 fixed dropdown options, plus the per-line field count, the line count and the byte totals.

Q: Can the 9 samples that failed to round-trip be recovered?

The differences come from exactly three places: in-field spaces trimmed away, blank lines and trailing newlines eaten, and the output joiner written differently. Working around those three is a separate question. The result over 20 samples holds only for these 20 entries and cannot be generalized into a claim that this page never restores the original.

Q: What about deleting characters per line or adding numbering?

That is line-level work. This page handles columns and joining, and anything inserted or removed inside a line belongs to another page.

📎 Related articles

The Page Lists Six Input Formats but Offers Only 3 Output Buttons: The Byte Budget of One 480x320 Image 2026-11-24 One Invalid Snippet Turns 100 Rows Into 0: Cell Values and the Row Ledger When JSON Becomes a Table 2026-11-24 24 whitespace code points survive even with every box checked: a per-code-point truth table for text trimming 2026-11-23 Paste 133 Characters, Copy Out 149: Six Rewrites of Value Text in the JSON View 2026-11-23 A malformed URL into the parser page: example.com:80 is read as the protocol, and %e stops the segment table halfway 2026-11-21