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

 

 

魂内検索

DOCUMENTS

COMMAND

FORUM

UEC DOCS

VIDEO

 

Alphabetical list

(Video materials in preparation)

linecut

Name

linecut : Splits a file into the specified number of lines

Synopsis

Usage   : linecut -<n> [-m <max>] <filename> <file>

          linecut -<n> -f <infofile> <file>

Version : Tue Jun 17 22:57:05 JST 2014

Description

Normal:

Splits <file> into multiple files of <n> lines. The resulting files

use the name <filename>. You can specify %05d in order to append

a sequential index to the name of the file.

The -m <max> option limits the number of resulting files to <max>

files. All remaining rows are added to the final file.

-f <infofile> option:

<infofile> is a text file consisting of two fields as follows:

max_number_of_files file_name

When <file> is split into files of <n> number of rows, the command

follows the settings in <infofile> and creates only max number of files.

If there are extra rows remaining, these are added to the end of the

last file.

The linecut command outputs the names of the resulting files.

If <file> is not specified or specified as "-" then the command reads from standard input.

Example 1

# Split into files of 1000 lines each

$ lcnt data

5000

$ linecut -1000 file.%02d data

file.01

file.02

file.03

file.04

file.05

$ lcnt -f file.[0-9][0-9]

file.01 1000

file.02 1000

file.03 1000

file.04 1000

file.05 1000

Example 2

# Splits into files of 1000 but limit to four files.

$ lcnt data

5000

$ linecut -1000 -m 4 file.%02d data

file.01

file.02

file.03

file.04

$ lcnt -f file.[0-9][0-9]

file.01 1000

file.02 1000

file.03 1000

file.04 2000      <= All remaining rows are added to the final file

Example 3

# Using infofile

$ lcnt data

5000

$ cat infofile

2 file1.%02d      <= Up to 2 files file1.01 file1.02

2 file2.%02d      <= Up to 2 files file2.01 file2.02

$ linecut -1000 -f infofile data

file1.01

file1.02

file2.01

file2.02

$ lcnt -f file[12].[0-9][0-9]

file1.01 1000

file1.02 1000

file2.01 1000

file2.02 2000     <= All remaining rows are added to the final file