Основной сайт хуманэмулятор.рф | Демо | Купить | API | Wiki
System / excelfile
dedupe_sheet
dedupe_sheet($path,$sheet,$use_cols="*",$is_header_exists=false,$timeout=3000,$header_length=1); - Убрать строки-дубликаты для Листа файла ExcelФункция на вход принимает параметры:
После выполнения функции возвращаемое значение будет равно одному из двух :
Пример использования
<?php // Scenario: Dedupe sheets in Excel file $xhe_host = getenv("RPABOT_HOST_URL"); // Connect functional objects if not already connected if (!isset($path)){ // Path to the init.php file for connecting to the XHE API $path = "../../../Templates/init.php"; // Including init.php grants access to all classes and functionality for working with the XHE API require($path); } echo "\n<span >excelfile->" . basename(__FILE__) . "</span>\n"; // Initialize Excel SYSTEM::$excel->kill(); // Example 1: Remove duplicates from sheet by specific columns echo("Example 1: Remove duplicates from sheet by specific columns : "); // Extract method arguments into variables $filePath = "test/test.xlsx"; $sheetIndex = 0; $columns = "C,D"; $result = SYSTEM::$excelfile->dedupe_sheet($filePath, $sheetIndex, $columns); if ($result === true) echo("true\n"); else echo("false\n"); // Example 2: Remove duplicates from sheet by all columns with header consideration echo("\nExample 2: Remove duplicates from sheet by all columns with header consideration : "); // Extract method arguments into variables $allColumns = "*"; $withHeader = true; $result = SYSTEM::$excelfile->dedupe_sheet($filePath, $sheetIndex, $allColumns, $withHeader); if ($result === true) echo("true\n"); else echo("false\n"); // View result // End of script echo "\n"; // Quit application WINDOW::$app->quit(); ?>
=============================================
excelfile Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.