Answer the question
In order to leave comments, you need to log in
How to display a csv file on a page with pagination in Bitrix?
Good afternoon! Tell me it is possible to implement the following: there is a csv file the size is 400mb. I do not want to fill the database with such a volume, since the data will change every month. I want to decide just by replacing a fresh file every month.
Is it possible to display information from csv on a page with filtering by fields and pagination, for example, 100 lines?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/csv_data.php");
$csvFile = new CCSVData('R', true);
$csvFile->LoadFile($_SERVER["DOCUMENT_ROOT"]."/baza/my.csv");
$bFirstHeaderTmp = $csvFile->GetFirstHeader();
$csvFile->SetDelimiter(',');
while ($arRes = $csvFile->Fetch()) {
}
Answer the question
In order to leave comments, you need to log in
In this case, you can do without a database, but this is a very crutch option:
It seems to me that it is better to use a table in the database, which will be cleared when a new csv is imported.
it is impossible, only in the database, do you suggest reading a 400mb file each time when loading the page?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question