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

 

 

魂内検索

DOCUMENTS

COMMAND

FORUM

UEC DOCS

VIDEO

 

Alphabetical list

(Video materials in preparation)

tagisort(USP)

Name

tagisort : In-Memory Sort for tag files

Synopsis

Usage   : tagisort key=<key> <file>

Options : -e

          -s<c>

          -p<n>

          --stable

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

Edition : 5

Description

Sorts a file on specfied key by <key>.  <key> 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.

If you specify the -p<n> option, the command will run in <n>

parallel processes.  There is no limit to the number of parallel

processes you can specify, but if you specify more processes

than there are cores available on your CPU then performance

will be degraded.  If you are sorting less than 10,000 lines,

even if you specify the -p<n> option it will only run in single

process.

--stable is prepared for compatibility with isort, and ignored by

this command.

Important

tagisort uses the intro sort algorithm (combinamtion of quick sort

and heap sort), so there is no danger that the processing time will

be extremely long no matter what state the input data is in.

Note

tagisort is an in-memory sort, so it will use at a maximum tow times

the memory as the size of the file being sorted.