在你的AIX上,cat a.txt >> b.txt需要几分钟?作者: wy94 时间: 2013-06-13 13:45
谢谢大家了,用cat需要大约40-50秒。
>ls -l a.txt b.txt
-rw-rw-r-- 1 iinscu tellin 994989614 Jun 13 08:36 a.txt
-rw-rw-r-- 1 iinscu tellin 117 Jun 13 08:36 b.txt
>wc -l a.txt b.txt
1074836 a.txt
1 b.txt
1074837 total
>date; cat a.txt >> b.txt; date
Thu Jun 13 08:37:06 SAUST 2013
Thu Jun 13 08:37:52 SAUST 2013
其实原始的需求是用户需要导出的数据在第一行带字段描述,而informix的unload没有追加到文件的功能
找了下面的可以实现了
unload/load, don´t have the posibility of append a file, but in other mail,
someone recomend you use a pipe.
If you are in a UNIX sistem, you can use this shell scrip:
# Append a file via pipe.
mknod /tmp/mypipe p
# My first unload create the asc file
nohup 'cat /tmp/mypipe > myappendfile.asc' &
echo "unload to '/tmp/mypipe' select * to mytable1" >a.sql
dbaccess mydb a.sql
# the second unload append the asc file
nohup 'cat /tmp/mypipe >> myappendfile.asc' &
echo "unload to '/tmp/mypipe' select * to mytable1" >a.sql
dbaccess mydb a.sql
# end of shell