Text file guides

Reverse Line Order and Keep Line Endings

·

When a status log arrives oldest first, reverse the entries to read the latest update at the top. A heading can stay in place. Open the original file when the spacing or line endings will matter to the application receiving the new order.

Line Reverser

Reverse the five-line status list

Open the mixed-ending status sample or choose Load example. The five lines contain Status, Draft with two spaces before a pin, a blank line, Café with a combining accent, and the Arabic word مراجعة. Select Reverse lines with both options cleared. The Arabic entry appears first, the accented entry second, the blank line third, the Draft line fourth, and Status last.

Arabic text keeps its original character order as it moves. The browser can render its letters in right-to-left reading order. Reordering lines leaves those characters, accents and emoji intact.

ToolMellow mixed-ending status listUnicode bidirectional text display

Hold the heading and blank row in place

Enable Keep first line and Keep blank lines in place, then reverse again. The new order is Status, مراجعة, the blank line, Café, and the Draft line. Disable Keep blank lines in place to free blank rows to move with the other lines.

For a shorter check, paste three separate lines A, B and C with a blank row between A and B. With both options cleared, the order becomes C, B, the blank row, and A. Keeping blank lines in place holds the blank row in its original second position.

ToolMellow mixed-ending status list

Check the file’s original ending pattern

Download the sample result and inspect it with the Line Ending Converter. The source and the result both use CRLF, LF, LF, CR, then CRLF. When you open the sample file rather than loading the built-in text, the download also keeps the UTF-8 byte-order mark.

A final separator terminates its line. The reversal preserves the separator slots. If an empty line moves between two slots where a lone CR meets a lone LF, an editor can recognize one CRLF in the download. Keep blank lines in place for ambiguous mixed-ending files. Use a file when inspecting bytes because an HTML text box displays normalized line endings.

ToolMellow mixed-ending status listHTML Standard, textarea API and newline normalizationUnicode character encoding and byte-order marks

Common questions

Why does the result look like it uses only one kind of newline?

The browser’s text box displays line breaks uniformly. Inspect the downloaded file with a line-ending checker to see its saved separator bytes.

Can I reverse the characters within each line instead?

Use Text Reverser’s Characters within each line mode. Line Reverser changes the position of each complete line.

Sources

Put it into practice.

Related guides