295

What was the original historical use of the vertical tab character (\v in the C language, ASCII 11)?

Did it ever have a key on a keyboard? How did someone generate it?

Is there any language or system still in use today where the vertical tab character does something interesting and useful?

Olivier Jacot-Descombes
  • 104,806
  • 13
  • 138
  • 188
dmazzoni
  • 12,866
  • 4
  • 38
  • 34
  • 11
    Great explanation here: http://en.wikipedia.org/wiki/Tab_key – Zabba Aug 01 '10 at 02:44
  • 3
    I've been using it in .vsv files so I don't have to think about how to quote textual data in my fields. – Ron Jul 17 '12 at 15:31
  • 1
    If you're considering such a thing for [delimiter-separated values](https://en.wikipedia.org/wiki/Delimiter-separated_values) like CSV & TSV, take a look at ASCII's four information separator characters, designed for four levels of hierarchy: `0x1c` (file separator ``^\``), `0x1d` (group separator `^]`), `0x1e` (record separator `^^`), and `0x1f` (unit separator `^_`). I think these didn't get better adoption because they're non-printing, but `\v` (`0x0b`, `^K`) might render as `\n\t` and be even worse. Vim shows vertical tabs and information separators by their control codes. – Adam Katz Oct 20 '22 at 15:42

10 Answers10

270

Vertical tab was used to speed up printer vertical movement. Some printers used special tab belts with various tab spots. This helped align content on forms. VT to header space, fill in header, VT to body area, fill in lines, VT to form footer. Generally it was coded in the program as a character constant. From the keyboard, it would be CTRL-K.

I don't believe anyone would have a reason to use it any more. Most forms are generated in a printer control language like postscript.

@Talvi Wilson noted it used in python '\v'.

print("hello\vworld")

Output:

hello
     world

The above output appears to result in the default vertical size being one line. I have tested with perl "\013" and the same output occurs. This could be used to do line feed without a carriage return on devices with convert linefeed to carriage-return + linefeed.

BillThor
  • 7,306
  • 1
  • 26
  • 19
  • 16
    It could also be use to scroll the screen quickly. Useful in the days of 300 Baud. – Talvi Watia Aug 01 '10 at 03:08
  • 8
    And some data providers like TechData use it in CSV files to replace \n. – Wiliam Nov 12 '13 at 09:05
  • 2
    @BillThor: Great, but what was the exact specification of VT? What did it actually do? I assume, based on your description, that it moved the imaginary "cursor" vertically down to the next "vertical tab" position. But did it also return the cursor to the beginning of the line? Or did it keep the X position of the cursor unchanged? – AnT stands with Russia Nov 08 '14 at 15:57
  • 3
    @AnderyT I believe the specification was to advance to the next tab stop down. Any horizontal movement would depend on the device. Line-feed was specified to advance to the next line, some devices would perform a carriage return as well, others would just advance the line and continue printing at the next character position. The `stty` `onlret` option provided consistent behavior by adding a carriage return to any line feeds. – BillThor Nov 08 '14 at 16:28
  • "I don't believe anyone would have a reason to use it any more." - one of the most important protocols in health-care HL7 uses to signal a starting message :-) Probably because this character will never occure in load-data. – Valentin H Jul 30 '15 at 12:20
  • 1
    @ValentinHeinitz Interesting re-purposing of the . There are control characters that are meant for that purpose such as (start of heading), (start of text) and the separator characters , , , and , all of which may be more obscure than . – BillThor Jul 30 '15 at 13:41
  • @BillThor Those control characters are great for storing user entered data since you don't need to worry about escaping characters since there are not valid for the input. – Sled Sep 26 '17 at 20:17
  • @ArtB: I can enter SOH and some others just fine, e.g. using copy+paste. What next? Forbid copy+paste? I can automatically enter stuff just fine without copy+paste, e.g. using KeePass. Never, never, never, never _assume_ the user is not able to enter something. – Sebastian Mach Jun 20 '18 at 08:55
  • @ArtB: Not wanting to provoke you, but I hope you don't spread such dangerous false wisdom in the company you work for as a tech lead? – Sebastian Mach Jun 20 '18 at 09:02
  • @SebastianMach what is dangerous about it? We only allowed (and validated) alphanumeric, punctuation, and space characters. As such, we knew our user input never contained them. Therefore, when storing data, we were free to use the to limit string to structure the data. Thus we avoided all the problems of having to quote or escape string contents. The code was cleaner and simpler. These characters were intended for such use in binary formats. I haven't used them in over 10 years, but it's still on the table for the right situation. As always, choose carefully, consider everything. – Sled Jun 20 '18 at 13:35
  • @ArtB: These specs were missing in your previous comment, which read like "if we use those as separators, no further work to ensure input consistency is required". Personally, when it comes to input, I am the whitelist kind of programmer: Everything forbidden, unless explicitly permitted. – Sebastian Mach Jun 20 '18 at 14:13
77

Microsoft Word uses VT as a line separator in order to distinguish it from the normal new line function, which is used as a paragraph separator.

tav
  • 587
  • 6
  • 9
dan04
  • 87,747
  • 23
  • 163
  • 198
  • 12
    So, this is shift-enter? – Timothy Lee Russell Mar 05 '14 at 00:34
  • 3
  • @dan04: Can you please update the link to the Microsoft Wordk KB article? – Alex Essilfie Aug 27 '15 at 19:09
  • 2
    This does also apply to OneNote (and probably every other MS Office Product with Word-like input). And contrary to @PraveenKumar, it does this when hitting Shift+Enter, *not* Ctrl+Enter. The latter does nothing, at least in my case. – Gerrit-K Mar 17 '17 at 10:45
  • @paulroho in Word, yes, in OneNote, no. I'm afraid that my previous statement about "probably every other MS Office Product with Word-like input" is not correct, as OneNote's input is not really an MS Office integration but rather a lookalike ... nevertheless, my second statement should still be valid: Shift+Enter inserts VT, *not* Ctrl+Enter (which inserts page break in Word and nothing in OneNote). – Gerrit-K Apr 19 '17 at 07:00
  • In Google Docs/Sheets/Slides/etc., the same thing holds true. The keyboard shortcut is `Shift`+`Enter`. – Solomon Ucko Mar 27 '19 at 00:38
20

In the medical industry, VT is used as the start of frame character in the MLLP/LLP/HLLP protocols that are used to frame HL-7 data, which has been a standard for medical exchange since the late 80s and is still in wide use.

James
  • 1,788
  • 4
  • 22
  • 28
15

It was used during the typewriter era to move down a page to the next vertical stop, typically spaced 6 lines apart (much the same way horizontal tabs move along a line by 8 characters).

In modern day settings, the vt is of very little, if any, significance.

Alex Essilfie
  • 12,339
  • 9
  • 70
  • 108
14

The ASCII vertical tab (\x0B)is still used in some databases and file formats as a new line WITHIN a field. For example:

andrewmacpherson
  • 1,404
  • 9
  • 14
Jack James
  • 5,252
  • 6
  • 36
  • 38
6

I have found that the VT char is used in pptx text boxes at the end of each line shown in the box in oder to adjust the text to the size of the box. It seems to be automatically generated by powerpoint (not introduced by the user) in order to move the text to the next line and fix the complete text block to the text box. In the example below, in the position of §:

"This is a text §
inside a text box"
merce_00
  • 289
  • 3
  • 6
3

A vertical tab was the opposite of a line feed i.e. it went upwards by one line. It had nothing to do with tab positions. If you want to prove this, try it on an RS232 terminal.

Seawolf409
  • 49
  • 1
  • 1
    I had hoped to have used the vertical tab in Python to navigate the console screen in Microsoft Windows console. But library msvcrt.putch(b'\v') does not operate so. – DevPlayer Feb 02 '19 at 17:22
2

I believe it's still being used, not sure exactly. There might be even a key combination of it.

As English is written Left to Right, Arabic Right to Left, there are languages in world that are also written top to bottom. In that case a vertical tab might be useful same as the horizontal tab is used for English text.

I tried searching, but couldn't find anything useful yet.

mtk
  • 13,221
  • 16
  • 72
  • 112
  • 11
    I thought of this, but then dismissed it because in vertical languages a normal tab would be semantically appropriate. – Ryan Hiebert May 02 '14 at 16:13
2

Similar to R0byn's experience (answer now hidden), I was experimenting with a Powerpoint slide presentation and dumped out the main body of text on the slide, finding that all the places where one would typically find carriage return (ASCII 13/0x0d/^M) or line feed/new line (ASCII 10/0x0a/^J) characters, it uses vertical tab (ASCII 11/0x0b/^K) instead, presumably for the exact reason that dan04 described above for Word: to serve as a "newline" while staying within the same paragraph. Good question though as I totally thought this character would be as useless as a teletype terminal today.

wescpy
  • 10,689
  • 3
  • 54
  • 53
0

I tried this code:

print("hello\vbanana")

on the Python 3.10.11 IDLE and got:

hellobanana

Then, I tried the same code in the command prompt and got:

hello
banana

So in some places, it renders as a weird character and on others it renders exactly like a newline. Note that I ran this on a Windows 11 computer.