(Video materials in preparation)
charsplit : Cuts a field into two fields of fixed length
Usage : charsplit [-b] [-c] <field>.<length> <file>
Version : Thu Jul 24 22:50:17 JST 2014
Splits the specified <field> into two fields of length <length>.
The length is display width (half width character = 1). If a
multi-byte character will be split in the middle of a chracter
then the field is split at the bigining of that character.
If you specify a length so that the field cannot be split, then
one field is output as "_".
The -b option uses byte length instead of display width.
The -c option uses number of characters instead of display width.
$ echo 1234 | charsplit 1.2
12 34
$ echo USP研究所 | charsplit 1.3
U SP研究所
$ echo USP研究所 | charsplit 1.1
_ USP研究所
$ echo 1234 | charsplit 1.5
1234 _
$ echo USP研究所 | charsplit -b 1.4
U SP研究所
$ echo USP研究所 | charsplit -c 1.4
USP研 究所