File Pointer

Topics: Developer Forum
Jan 5, 2012 at 9:57 AM

Is there any file pointer like ftell(), so we can store current pointer and read data from that specific point, at later time. My aim is to read a huge csv/xls/xlsx file using PHPExcel by using the following logic :

1. Read 100 lines.

2. Accessing current file pointer and saves in db.

3. Starts reading the file from 101('100' stores in db and starts reading from 100+1)



Jan 5, 2012 at 11:34 AM

There are examples of reading a spreadsheet in "chunks" in the "PHPExcel User DocumentationReading Spreadsheet Files" document in /Documentation. Look at section 4.3 entitled "Reading Only Specific Columns and Rows from a File (Read Filters)".

Jan 6, 2012 at 10:14 AM

Mark, Thank you very much for your quick response. Also, I would like to know whether there is any function for getting total number of rows in csv/xls/xlsx file.

Jan 6, 2012 at 11:38 AM

Never mind. I got it !   'getHighestRow()'