Line Interleaver

Alternate lines from two text inputs, preserving order and keeping the longer input’s remaining lines.

Takes one line from A, then one from B. Unequal lengths retain all remaining lines; no matching or deduplication.

Processing stays in this browser. Input limit: 100,000 UTF-16 code units and 10,000 logical lines per source.

Line Interleaver: control text line structure

Paste sources into Input text and Second input. Select Process text to alternate entries. The first source always supplies the first line when it is nonempty.

Try the example

The example has three lines in A and two in B. Output has five lines in the displayed order. A3 is retained after the shorter source is exhausted. If one source is empty, the other appears in its original order.

Exact transformation rules

This operation combines sequence positions, not identities. Repeated lines and explicit empty lines are retained. No sorting or duplicate removal occurs. An empty source contains zero lines, and a final terminator does not add an extra entry. Original CRLF/CR separators become LF in output, with no final terminator added.

Use interleaving for alternating prompts and answers or combining ordered labels. If you need two-column pairs with unambiguous boundaries instead, use List Pairing Tool. It is not a time-based merge of event records.

Limits and result review

The operation has no extra settings; its line handling is fixed. Each input supports 100,000 UTF-16 code units and 10,000 logical lines. Unpaired UTF-16 surrogates are rejected so UTF-8 export does not silently replace them. Browser textareas may normalize CRLF or CR before processing. A result consisting of an empty entry can produce a zero-byte file; inspect the reported count and source before treating it as no data.

Changing text or settings clears the old preview and download links. Processing does not overwrite a local source file. Download results before reloading if you need to keep them.

Use Unicode Code Point Inspector to inspect unexpected character sequences. Use Line Range Extractor when the task is selecting specific consecutive lines rather than changing their layout.