Record Separator Character (U+001E): How to Spot, Check and Handle It
What the record separator control character (RS, U+001E, 0x1E) is, how it shows up in text, how to detect it with common tools, and how to keep, replace or remove it safely.
The record separator, often abbreviated RS, is an invisible control character. It does not draw a glyph. Its job is to mark the boundary between one record and the next in structured data. When it ends up in ordinary text, it can split strings unexpectedly, break imports or make two values look joined. This guide explains what the character is, how to confirm that it is present, and how to deal with it without changing anything else in your text.
What the record separator is
RS is one of the C0 control codes inherited from ASCII. In Unicode it is the code point U+001E, with the general category Cc (control). It is one of four "information separators" that were designed to mark nested levels of data, from largest to smallest unit.
| Name | Abbreviation | Code point | Decimal | Hex | Octal | Caret notation |
| File separator | FS | U+001C | 28 | 0x1C | 034 | ^ |
| Group separator | GS | U+001D | 29 | 0x1D | 035 | ^] |
| Record separator | RS | U+001E | 30 | 0x1E | 036 | ^^ |
| Unit separator | US | U+001F | 31 | 0x1F | 037 | ^_ |
Unicode also has a visible stand-in, U+241E SYMBOL FOR RECORD SEPARATOR (␞). It is a separate, printable character. Some tools display ␞ to show where an RS sits, but the symbol is not the control character itself. Searching for one will not find the other.
What it does to your text
The record separator carries no visible content. Its only effect is structural: a program that knows the convention treats the character as a boundary between records. Programs that do not know the convention handle it in different ways. They may ignore it, show a placeholder box, or treat it as a line or paragraph break.
- Data formats that use it on purpose: JSON Text Sequences (RFC 7464, media type application/json-seq) put RS before each JSON text in a stream. MARC 21 bibliographic records use 0x1E as the field terminator.
- Unintended sources: text copied from legacy systems, exports from databases or mainframe tools, and pasted data from terminals or binary files.
- Visible symptoms: two words that appear joined with nothing between them, a string whose length is one more than you count, a lookup or comparison that fails for no visible reason, or an unexpected line break in some editors but not others.
There is one Unicode detail behind several of these surprises. U+001E has the bidirectional class B, which is the paragraph-separator class. As a result, some libraries treat it as a line boundary. In Python, for example, str.splitlines() breaks at \x1e, and '\x1e'.isspace() returns True, so a plain str.split() with no arguments also splits on it. If your data uses RS as a deliberate separator, these generic functions can cut records in places you did not intend.
Don't confuse it with awk's RS variable
In awk, RS is the name of a variable: the input record separator, which defaults to a newline. The name is the same, but the concept is different. You can set the awk variable to the actual control character if your data uses it. In GNU awk, for example, you can write -v RS='\x1e'. Check your awk implementation's documentation, because escape handling differs between versions.
How to recognize it step by step
Most editors and browsers will not show anything at the character's position, so look at the raw bytes or code points instead. The commands below are illustrative examples using the sample string alpha, then RS, then beta. The outputs shown describe the documented, typical behavior of these tools. They are not a recorded test on your system.
1. Make it visible in a terminal
# Example: create a sample and show control characters in caret notation
printf 'alpha\x1ebeta\n' | cat -v
# Expected display: alpha^^beta
In the output of cat -v, the two-character sequence ^^ stands for RS. A real caret in your text would appear as a single ^, so a doubled caret between letters points strongly to 0x1E.
2. Confirm the exact byte
# Hex view: look for the byte 1e
printf 'alpha\x1ebeta\n' | xxd
# Octal/character view: RS appears as 036
printf 'alpha\x1ebeta\n' | od -c
RS is a single byte, 0x1E, in ASCII and in UTF-8, so a hex dump makes it easy to tell apart from similar characters. The visible symbol ␞ (U+241E) is different: in UTF-8 it takes three bytes, e2 90 9e.
3. Search files for it
# List lines containing RS (GNU grep with Perl-compatible regex)
grep -nP '\x1e' file.txt
# Portable alternative using a shell-expanded literal
grep -n "$(printf '\036')" file.txt
4. Check in code
# Python
s = 'alpha\x1ebeta'
print('\x1e' in s) # True
print(repr(s)) # 'alpha\x1ebeta'
print(s.split('\x1e')) # ['alpha', 'beta']
// JavaScript
const s = 'alpha\u001Ebeta';
console.log(/\u001E/.test(s)); // true
console.log(JSON.stringify(s)); // "alpha\u001ebeta"
Printing the escaped form of a string is the most reliable check in code. In Python, use repr(). In JavaScript, JSON.stringify() escapes control characters below U+0020. Do not rely on print() or console output alone, because the terminal may show nothing at all.
5. Use a regex pattern that targets only RS
Most regex engines accept \x1E, and many also accept \u001E or \x{1E}. To match RS specifically, use one of these exact escapes. A broad class such as \s or [[:cntrl:]] may also match newlines, tabs or the other separators, and that would change content you meant to keep.
Deciding whether to keep, replace or remove it
Before changing anything, find out whether the character is structural. If the data is a JSON text sequence, a MARC record or any export that uses RS as its delimiter, removing it will merge records. If the data is free text and the RS arrived by accident, removing it or replacing it is usually safe.
# Remove every RS (only if it carries no structure)
tr -d '\036' < input.txt > output.txt
# Turn each RS into a newline (one record per line)
tr '\036' '\n' < input.txt > output.txt
# Python equivalent of the replacement
text = text.replace('\x1e', '\n')
After the change, run the detection step again to verify the result. A search for \x1e should return nothing. Also compare the record or line count with what you expected, and if the input had other control characters that you wanted to keep, check that they are still present in a hex dump.
Gaps to be aware of
How a given editor, spreadsheet or database displays or imports RS depends on the product and its version. No product-specific behavior was verified for this guide. If a particular application matters to your workflow, test it with a small sample file that contains a known RS before you process real data.