中司と申します。 On Thu, 26 Nov 2009 23:47:04 +0900 hayasi <[email protected]> wrote:
> 以下のように1列にずらっとランダムなデータ(数字)
> が記録されたテキストファイルを
>
> 01
> 02
> 03
> 04
> 05
> 06
> 07
> 08
> 09
> 10
> 11
> 12
> 13
> 14
> 15
> 16
> 17
> 18
> 19
> ・
> ・
> ・
上記記述内容が aaa.txt に格納されているとします。
以下のようなshell でいけます。
#もっとエレガントに出来そうな気もしますが...
#!/bin/bash
let cnt=0
for aa in `cat aaa.txt`; do
let tmp="$cnt % 16"
if [ $tmp -eq 0 ] ; then
echo
fi
let cnt=$cnt+1
echo -n "$aa "
done
echo
