- 论坛徽章:
- 0
|
本帖最后由 dsadjkasd 于 2012-08-22 20:44 编辑
回复 6# zhlong8
#!/usr/bin/perl
@file = glob "/cygdrive/e/merge_sinadata/stk_daily_*.txt";
foreach my $fl (@file){
print "read $fl\n";
open file,"$fl";
foreach(<file>){
$_ =~ /^(\d{6})\t(\d{8})\t/;
push(@a,$_);
# $stk{$1}{$2} = $_;
}
close file;
}
hash直接跳出了.
试了数组,报错报Out of memory during "large" request for 33558528 bytes, total sbrk() is 393666560 bytes at mem_test.pl line 9,<file> line 404302.
版主请解惑.
忘了说了我是在cygwin环境下运行perl的,机器是64位的win7.
然后源文件大约有700万行,大小在320mb |
|