Tab character separated fields
Tab character separated fields

Use a tab character to separates individual fields.


Define separator character
Variable definition
Notes
This declaration relies on the C Virtual Machine to initialize the variable unique to zero.
Segment Source
 190: /* Tab character separating fields.  If NUL, then fields are separated
 191:    by the empty string between a non-whitespace character and a whitespace
 192:    character. */
 193: static char tab;
 194: 

Insert user message text
Text insertion
Segment Source
 234:   -t SEP           use SEParator instead of non- to whitespace transition\n\

Find beginning of field
Code insertion
Notes
The definition of tab as a field separator includes its behavior when it is null. If tab is not defined, then the default behavior is to separate fields based on white space transistions (a.k.a. WhiteSep).
Segment Source
 545:   if (tab)
 546:     while (ptr < lim && sword--)
 547:       {
 548:         while (ptr < lim && *ptr != tab)
 549:           ++ptr;
 550:         if (ptr < lim)
 551:           ++ptr;
 552:       }
 553:   else

Find end of field
Code insertion
Notes
The definition of tab as a field separator includes its behavior when it is null. If tab is not defined, then the default behavior is to separate fields based on white space transistions (a.k.a. WhiteSep).
Segment Source
 594:   if (tab)
 595:     while (ptr < lim && eword--)
 596:       {
 597:         while (ptr < lim && *ptr != tab)
 598:           ++ptr;
 599:         if (ptr < lim && (eword || echar > 0))
 600:           ++ptr;
 601:       }
 602:   else

Parse TabSep option (-t)
Code insertion
Segment Source
1975:                   case 't':
1976:                     if (s[1])
1977:                       tab = *++s;
1978:                     else if (i < argc - 1)
1979:                       {
1980:                         tab = *argv[++i];
1981:                         goto outer;
1982:                       }
1983:                     else
1984:                       error (SORT_FAILURE, 0,
1985:                              _("option `-t' requires an argument"));
1986:                     break;