humanemulator.net — справка. Продукт, демо и покупка — на хуманэмулятор.рф | Демо | Купить | API | Changelog

set_table_cell_value_separator

set_table_cell_value_separator($table_cell_value_separator,$timeout=300); -

:

  • $table_cell_value_separator
  • $timeout ,

    :
  • true
  • false

    <?php
    /**
     * Example for set_table_cell_value_separator function
     *
     * This example demonstrates how to set the separator used for table cell values
     * when extracting table content from ODT files using the XHELibreOffice class.
     */
    
    // Scenario: Set the separator used for table cell values when extracting table content from ODT files
    
    $xhe_host = getenv("RPABOT_HOST_URL");
    
    //   ,    
    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 >libreOffice->".basename (__FILE__)."</span>\n";
    
    // Example 1: Set a pipe separator
    echo "\n\nExample 1: Setting a pipe separator\n";
    $separator = " | ";
    $result = SYSTEM::$libreOffice->set_table_cell_value_separator($separator);
    
    if ($result) {
        echo "Successfully set table cell separator to: '{$separator}'\n";
    } else {
        echo "Error: Failed to set table cell separator.\n";
    }
    
    // Example 2: Test the separator by extracting table content
    echo "\n\nExample 2: Testing the separator by extracting table content\n";
    $filePath = "test/test_style.odt";
    $tableCount = SYSTEM::$libreOffice->get_table_text_blocks_count_odt($filePath);
    
    if ($tableCount > 0) {
        echo "Found {$tableCount} tables. Extracting first table with pipe separator:\n";
        
        $tableText = SYSTEM::$libreOffice->get_table_text_block_by_index_odt($filePath, 0);
        if (!empty($tableText)) {
            echo $tableText . "\n";
        }
    } else if ($tableCount == 0) {
        echo "No tables found in the document.\n";
    } else {
        echo "Error: Failed to count tables.\n";
    }
    
    // Quit the application
    WINDOW::$app->quit();
    
    ?>
    # Example for set_table_cell_value_separator function
    # 
    # This example demonstrates how to set the separator used for table cell values
    # when extracting table content from ODT files using the XHELibreOffice class.
    
    import sys
    sys.path.insert(0, '../../../Templates PY/')
    
    xhe_host = "127.0.0.1:7013"
    from xweb_human_emulator import libreOffice, app, echo
    
    # 
    echo("<hr><font color=blue>libreOffice->set_table_cell_value_separator</font><hr>")
    
    # Example 1: Set a pipe separator
    echo("Example 1: Setting a pipe separator\n");
    separator = " | ";
    result = libreOffice.set_table_cell_value_separator(separator);
    
    if result:
        echo("Successfully set table cell separator to: '{separator}'\n");
    else:
        echo("Error: Failed to set table cell separator.\n");
    
    # Example 2: Test the separator by extracting table content
    echo("\nExample 2: Testing the separator by extracting table content\n");
    filePath = "test/test_style.odt";
    tableCount = libreOffice.get_table_text_blocks_count_odt(filePath);
    tableCount = int(tableCount)
    
    if tableCount > 0:
        echo("Found {tableCount} tables. Extracting first table with pipe separator:\n");
        
        tableText = libreOffice.get_table_text_block_by_index_odt(filePath, 0);
        if tableText:
            echo(f"{tableText} \n");
    elif tableCount == 0:
        echo("No tables found in the document.\n");
    else:
        echo("Error: Failed to count tables.\n");
    
    
    # Quit
    app.quit()
    using System;
    
    /**
     * Example for set_table_cell_value_separator function
     *
     * This example demonstrates how to set the separator used for table cell values
     * when extracting table content from ODT files using the XHELibreOffice class.
     */
    
    // Scenario: Set the separator used for table cell values when extracting table content from ODT files
    
    namespace XHELibreOfficeExamples
    {
        class SetTableCellValueSeparatorExample
        {
            static void Main(string[] args)
            {
                string xheHost = "127.0.0.1:7010";
    
                // Initialize XHE API connection
                // In C#, you would initialize the XHE API client here
                // This is equivalent to including init.php in PHP
    
                Console.WriteLine("\nlibreOffice->set_table_cell_value_separator.cs");
    
                // Example 1: Set a pipe separator
                Console.WriteLine("\n\nExample 1: Setting a pipe separator");
                string separator = " | ";
                bool result = libreOffice.set_table_cell_value_separator(separator);
    
                if (result)
                {
                    Console.WriteLine($"Successfully set table cell separator to: '{separator}'");
                }
                else
                {
                    Console.WriteLine("Error: Failed to set table cell separator.");
                }
    
                // Example 2: Test the separator by extracting table content
                Console.WriteLine("\n\nExample 2: Testing the separator by extracting table content");
                string filePath = "test/test_style.odt";
                int tableCount = libreOffice.get_table_text_blocks_count_odt(filePath);
    
                if (tableCount > 0)
                {
                    Console.WriteLine($"Found {tableCount} tables. Extracting first table with pipe separator:");
    
                    string tableText = libreOffice.get_table_text_block_by_index_odt(filePath, 0);
                    if (!string.IsNullOrEmpty(tableText))
                    {
                        Console.WriteLine(tableText);
                    }
                }
                else if (tableCount == 0)
                {
                    Console.WriteLine("No tables found in the document.");
                }
                else
                {
                    Console.WriteLine("Error: Failed to count tables.");
                }
    
                // Quit the application
                app.quit();
            }
        }
    }
    /**
     * Example for set_table_cell_value_separator function
     * 
     * This example demonstrates how to set the separator used for table cell values
     * when extracting table content from ODT files using the XHELibreOffice class.
     */
    
    xhe_host = "127.0.0.1:7013";
    
    //   ,    
    require("../../../Templates JS/init.js");
    
    // 
    echo("<hr><font color=blue>libreOffice.set_table_cell_value_separator</font><hr>");
    
    // Example 1: Set a pipe separator
    echo("Example 1: Setting a pipe separator\n");
    const separator = " | ";
    const result = libreOffice.set_table_cell_value_separator(separator);
    
    if (result) {
        echo("Successfully set table cell separator to: '{separator}'\n");
    } else {
        echo("Error: Failed to set table cell separator.\n");
    }
    
    // Example 2: Test the separator by extracting table content
    echo("\nExample 2: Testing the separator by extracting table content\n");
    const filePath = "test/test_style.odt";
    const tableCount = libreOffice.get_table_text_blocks_count_odt(filePath);
    
    if (tableCount > 0) {
        echo("Found {tableCount} tables. Extracting first table with pipe separator:\n");
        
        const tableText = libreOffice.get_table_text_block_by_index_odt(filePath, 0);
        if (tableText) {
            echo(tableText + "\n");
        }
    } else if (tableCount === 0) {
        echo("No tables found in the document.\n");
    } else {
        echo("Error: Failed to count tables.\n");
    }
    
    // Quit
    app.quit();

    =============================================
    libreoffice        DOM  System  Vision  Web  Window        
    =============================================
    - ,
    .