uspTukubaiコマンドに関する様々な資料がここにあります。

 

 

魂内検索

DOCUMENTS

COMMAND

FORUM

UEC DOCS

VIDEO

 

Alphabetical list

(Video materials in preparation)

tagpsort(USP)

Name

tagpsort : Partial Sort for tag files

Synopsis

Usage   : tagpsort ref=<ref> key=<key> <file>

Options : -e

          -s<c>

          --stable

Version : Tue Jan  9 09:02:34 JST 2024

Edition : 4

Description

Sorts the <key> field for all records that have the same value in

the <ref> field.  It sorts in small chunks so it is much faster than

sorting the entire file.  <key> and <ref> designates the field

position as fllows:

single field       TAGa       TAGa field

contiguous fields  TAGa/TAGb from TAGa field to TAGb field

combination        TAGa@TAGb  TAGa field and TAGb field

There is no limit on the length of the key field or on the number

of key fields.  The key field can also contain multi-byte characters

such as Japanese.

If you specify ":r" as sort method after the field position, the

values will be sorted in descending order.  If you specify ":n" as

sort method after the field position, that field's values will be

sorted as numbers.  If you specify ":nr" as sort method after the

field, the values will be sorted in descending order as numbers.  If

you specify sort method before or after the "/", you must use the

same sort method for both fields.

  TAGa:n/TAGb:n     OK

  TAGa:n/TAGb:nr    Error

  TAGa:n/TAGb:r     Error

When you specify ":e" as sort method or specify -e ootion and no

method, characters in the field are replaced as follows and compared

as string:

  _  ==> 0x20 (space)

  \0 ==> 0x00 (null)

  \t ==> 0x09 (tab stop)

  \n ==> 0x0a (new line)

  \r ==> 0x0d (carrige return)

  \_ ==> 0x5f (underscore)

  \\ ==> 0x5c (back slash)

The tag name specfying the field can be eclosed by braces {}.  In

this case, tag names can include special charcter like "/" or "@".

Moreover, tag names can include pairs of braces.  When sort method

is attached to brace enclosed tag name, ":" should be ommited.

    {TAGa}n/{TAGb}n

If the file name is omitted or if it is specified as "-" then the

command will read from standard input.

The character "_" repalces by space can be chaned by -s<c> option.

Example 1

$ cat data

T1 T2 T3

A B 1

A A 2

A E 3

A C 4

A D 5

B B 1

B A 2

B E 3

B C 4

B D 5

$ tagpsort ref=T1 key=T2 data

T1 T2 T3

A A 2

A B 1

A C 4

A D 5

A E 3

B A 2

B B 1

B C 4

B D 5

B E 3