Okay
  Public Ticket #3588802
Change csv separator in exported csv from , to ;
Closed

Comments

  • Laszlo Fabian started the conversation

    Hey Dear Support, 

    Is there an option to remove the " from the column values and change the column separator from , to ; in the csv export file? 
    I mean, the current export is
    "column1","column2","column3"

    And I need this
    column1;column2;column3

    Thank you in advance for your help.

    Br, Laszlo

  •  1,846
    Miloš replied

    Hi Laszlo,

    I will have to check about this with our Developers.

    At the moment, we do not have a built-in way as an option you could choose, but there could be a custom code edit workaround.

    As soon as our Developers check this, I will report back right away to confirm it for you.

    Thank you for your patience.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1,846
    Miloš replied

    Hi Laszlo,

    My apologies that it took so long.

    Thank you for your patience.

    We have got a custom workaround from our Developers which can help you modify the Export CSV separator from , to ; .

    Here are the instructions.

    Please access your WordPress folder via FTP/ or your Hosting provider's File Manager, and go to our Plugin's files.

    Find the PHP file in this path :

    ..\wp-content\plugins\wpdatatables\source\class.wpdatatable.php

    Find this piece of code, lines between 5001 and 5012

                   if (!empty($this->_tableToolsConfig['csv'])) {
                        $exportButtons[] =
                            array(
                                'extend' => 'csvHtml5',
                                'exportOptions' => array(
                                    'columns' => ':visible',
                                    'stripHtml' => $tableToolsIncludeHTML
                                ),
                                'title' => $wdtExportFileName,
                                'text' => __('CSV', 'wpdatatables')
                            );
                    }
    2678137845.png

    Replace it with this :

    if (!empty($this->_tableToolsConfig['csv'])) {
        $exportButtons[] =
            array(
                'extend' => 'csvHtml5',
                'exportOptions' => array(
                    'columns' => ':visible',
                    'stripHtml' => $tableToolsIncludeHTML
                ),
                'title' => $wdtExportFileName,
                'fieldSeparator' => ';',
                'text' => __('CSV', 'wpdatatables')
            );
    }
    

    Then, find the lines between 5087-5099  :

                  if (!empty($this->_tableToolsConfig['csv'])) {
                        $obj->dataTableParams->buttons[] =
                            array(
                                'extend' => 'csvHtml5',
                                'exportOptions' => array(
                                    'columns' => ':visible',
                                    'stripHtml' => $tableToolsIncludeHTML
                                ),
                                'className' => 'DTTT_button DTTT_button_csv',
                                'title' => $wdtExportFileName,
                                'text' => __('CSV', 'wpdatatables')
                            );
                    }
    5452039726.png

    Replace it with this :

    if (!empty($this->_tableToolsConfig['csv'])) {
        $obj->dataTableParams->buttons[] =
            array(
                'extend' => 'csvHtml5',
                'exportOptions' => array(
                    'columns' => ':visible',
                    'stripHtml' => $tableToolsIncludeHTML
                ),
                'fieldSeparator' => ';',
                'className' => 'DTTT_button DTTT_button_csv',
                'title' => $wdtExportFileName,
                'text' => __('CSV', 'wpdatatables')
            );
    }
    

    6771943245.png

    Save the changes, and now try to export another CSV from a Table and check if it works  - it should change the export delimiter.

    I just tested this on my Site, and it works :

    7191425949.png

    5445718145.png

    Let me know if that works for you.


    Please note every time you update the Plugin, this code edit will be overridden, and it will revert to the default delimiter.

    So if you update, you would need to repeat these steps.

    You can add a development suggestion to add a built-in option in the Plugin; but I can't promise an ETA.

    Please feel free to search on our suggestions page

     to see if someone may be already suggested this feature. If you can't see it, feel free to add your suggestion there,  and as more people vote, the feature will move higher on the priority list.

    You can certainly follow our changeLog page if you'd like ( it is also available in the plugin dashboard), where we state any changes/new features/bug fixes during updates;

    and our newsletter, so you're informed about new features, bug fixes, freebies, etc.



    2. But, when it comes to the second point you need, if you need to exclude each value having the quotes wrapped around them like  "value 1";"value 2";  but if you would instead remove the quotes and just have the pure values only with the delimiter;

    Sorry to disappoint you, but at the moment we do not have any way even with a custom solution to avoid our Plugin adding the quotes around each value.


    If you wish to see an option for that in the futue, you can add another development suggestion the same way as explained above.

    Right now, we don't have any workaround to offer.


    It probably can be done with some custom work, but our developers are very busy at the moment, working on some priority tasks and fixing bugs and issues with our plugins, so they won't be having the time for custom work in the near future.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •  1,846
    Miloš replied


    Hi Laszlo,

    Sorry once again - i just sent you all the steps to edit the code yourself, but I should also send you the 'finished/edited' PHP file, so this way you can just upload and overwrite it via FTP without having to edit the code.

    So now I am also sending you the edited PHP file, you can just use it without having to edit the code yourself.

    Just extract the PHP file from the Zipped folder i sent -

    then  access your WordPress files via FTP ( or Hosting File Manager) and overwrite the existing file by uploading this one in the path :

    ..\wp-content\plugins\wpdatatables\source\class.wpdatatable.php


    If you can't do that from your end, we can upload and overwrite the file for you.

    If you need us to do it, we would need the following access :

    Please provide me the URL of your Site along with Administrator user credentials for your website where this happens, 

    as well as FTP credentials 

    so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. 

    We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course, we do not provide login data to third parties. 

    You can write credentials here just check PRIVATE Reply so nobody can see them except us.


    So let me know if you manage to do this on your end and if it works;

    or if you need us to do it for you.


    Thank you.

    Attached files:  class.wpdatatable.php.zip

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Laszlo Fabian replied

    Hi Miloš,

    I greatly appreciate your help and your reply.
    Let me check it on next week and I will back to you with the outcome.
    Wish you all the best for You and your team for the next weeks. 
    Thank you and with warm regards, Laszlo 

  •  1,846
    Miloš replied

    Hi Laszlo,

    You're welcome.

    No problem at all, take your time and let me know how it goes when you try the proposed solution.

    Thanks.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •   Laszlo Fabian replied privately
  •   Miloš replied privately
  •   Laszlo Fabian replied privately
  •   Miloš replied privately