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

 

 

魂内検索

DOCUMENTS

COMMAND

FORUM

UEC DOCS

VIDEO

 

Alphabetical list

(Video materials in preparation)

tagdivk

Name

tagdivk : Divide the specified field by 1000

Synopsis

Usage   : tagdivk [-s] <f1> <f2> ... <file>

Version : Mon Jun  2 19:05:05 JST 2014

Description

Divides the numeric text data passed as the argument or via

standard input by 1000 and outputs the answer.

Used when creating a report in units of 1000s.

Each field to be divided by 1000 can be specified

in arbitrary as the argument. The resulting value is rounded

to the nearest whole number.

If you use the "-s" option the resulting value is not rounded

and the result is output including any decimals

Example 1

$ cat data

date value1 value2

20060201 296030 6710000

20060202 1300100 3130000

20060203 309500 20100

20060204 16300 300100

20060205 41000 210000

20060206 771100 400000

Divide the second and third field by 1000

$ tagdivk value1 value2 data

date value1 value2

20060201 296 6710

20060202 1300 3130

20060203 310 20

20060204 16 300

20060205 41 210

20060206 771 400

If you use the "-s" option the resulting value is not rounded

and the result is output including any decimals

You can use the "round" command for post-processing.

$ tagdivk -s value1 value2 data

date value1 value2

20060201 296.030 6710.000

20060202 1300.100 3130.000

20060203 309.500 20.100

20060204 16.300 300.100

20060205 41.000 210.000

20060206 771.100 400.000

Note

If you use the pipe to send the output from "tagdivk" to "tagdivk" a

second time, you can create data displayed in units of a million.

In this case, -s option is should be used to first tagdivk to avoid

multiple rounding.

$ (echo TAG; echo 2499500) | tagdivk TAG | tagdivk TAG

3

$ (echo TAG; echo 2499500) | tagdivk -s TAG | tagdivk TAG

2