|
@@ -101,7 +101,7 @@ class importer
|
|
|
/**
|
|
|
* read data from file and fill into this _header & _data
|
|
|
*/
|
|
|
- public function read_data()
|
|
|
+ public function read_data($start=0)
|
|
|
{
|
|
|
$encoding = $this->encoding();
|
|
|
if($encoding == false) return false;
|
|
@@ -110,14 +110,21 @@ class importer
|
|
|
|
|
|
$file = @fopen($this->_file, 'r');
|
|
|
$i = 0;
|
|
|
- while( !@feof($file) )
|
|
|
+ $limit = 1000;
|
|
|
+ $index = 1;
|
|
|
+ if( $start>0 ) {
|
|
|
+ $index = $start * 1000 - 1;
|
|
|
+ }
|
|
|
+ while( !@feof($file) && $limit > 0 )
|
|
|
{
|
|
|
if( $line = @fgets($file) )
|
|
|
{
|
|
|
if($i == 0) {
|
|
|
$this->_header = explode(self::_delimiter, trim(iconv($encoding, 'UTF-8', $line)));
|
|
|
- } else {
|
|
|
- $data[] = explode(self::_delimiter, trim(iconv($encoding, 'UTF-8', $line)));
|
|
|
+ } else if($i == $index) {
|
|
|
+ $data[$index] = explode(self::_delimiter, trim(iconv($encoding, 'UTF-8', $line)));
|
|
|
+ $index++;
|
|
|
+ $limit--;
|
|
|
}
|
|
|
$i++;
|
|
|
}
|