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

 

 

魂内検索

DOCUMENTS

COMMAND

FORUM

UEC DOCS

VIDEO

 

Alphabetical list

(Video materials in preparation)

transpose 

Name

transpose : Transposes rows and columns

Syntax

Usage   : transpose [-i<string>] <file>

Version : Mon Mar 18 17:08:43 JST 2013

Description

Transposes rows in <file> into columns.

If <file> is omitted or specified as "-" then the command

reads from standard input.

Example 1

$ cat data

1 2 3

A B C

4 5 6

$ transpose data

1 A 4

2 B 5

3 C 6

Example 2

Transpose the output of the map command

$ cat data

A 10/01 1

A 10/02 2

A 10/03 3

B 10/01 4

B 10/02 5

B 10/03 6

$ map num=1 data | fcols

* 10/01 10/02 10/03

A     1     2     3

B     4     5     6

$ map num=1 data | transpose | fcols

*     A B

10/01 1 4

10/02 2 5

10/03 3 6

Example 3

The "-i" option will add fields where they are missing. The added

field consists of an underscore character ("_").

$ cat data

1 2 3

A B

4 5 6 7

$ transpose -i data

1 A 4

2 B 5

3 _ 6

_ _ 7

Example 4

If you specify <string> then the missing fields are replaced by <string>.

$ transpose -i@ data

1 A 4

2 B 5

3 @ 6

@ @ 7

Note

The transpose command reads the entire input file into memory.