Import CSV default coma to point-coma
Import CSV default coma to point-coma
Hi,
how to change de default , to ; into import
Thanks
Rudy
how to change de default , to ; into import
Thanks
Rudy
Re: Import CSV default coma to point-coma
Hello Rudy
When importing, simply click in the marked field and change.
Kind regards Figo
When importing, simply click in the marked field and change.
Kind regards Figo
Re: Import CSV default coma to point-coma
Good morning,
thank you, that's what I do, but I would have liked to have the default ; and not ,
Rudy
thank you, that's what I do, but I would have liked to have the default ; and not ,
Rudy
Re: Import CSV default coma to point-coma
Hello Rudy
You can change the comma there to a semicolon. Just click and change.
Best regards
Figo
You can change the comma there to a semicolon. Just click and change.
Best regards
Figo
Re: Import CSV default coma to point-coma
I understand, but I would like it to be a semicolon by default
Re: Import CSV default coma to point-coma
In AppGini you can change the delimiter from a comma to a semicolon by default when you want to upload a CSV file. Here are the steps to do it:
Go to your AppGini project and open the "hooks" directory.
Create a new PHP file named "init.php" if this file doesn't already exist.
Open the "init.php" file and paste the following code:
Save the file and upload the changes to your server.
After following these steps, the delimiter in your AppGini project will default to a semicolon when you upload a CSV file. Please note that this change applies to all CSV files in your project. If you want to change the delimiter for a specific CSV file, you can change this in the Import Settings page.
Best regards Figo
Kommando retour! Geht nicht!
Go to your AppGini project and open the "hooks" directory.
Create a new PHP file named "init.php" if this file doesn't already exist.
Open the "init.php" file and paste the following code:
Code: Select all
<?php
$config['csv_separator'] = ';'; // Ändern Sie das Trennzeichen hier auf das Semikolon
?>
After following these steps, the delimiter in your AppGini project will default to a semicolon when you upload a CSV file. Please note that this change applies to all CSV files in your project. If you want to change the delimiter for a specific CSV file, you can change this in the Import Settings page.
Best regards Figo
Kommando retour! Geht nicht!
Re: Import CSV default coma to point-coma
Hello,
Thanks for this tip but it doesn't work, I'm in version 23.10
Rudy
Thanks for this tip but it doesn't work, I'm in version 23.10
Rudy
Re: Import CSV default coma to point-coma
I could be wrong but I don't think you will be able to achieve what you're after (change separator for Import CSV) using hooks.
I think you will need to edit a core generated file, which of course presents problems of it's own when regenerating an app.
The function appears to managed in \resources\lib\CSVImportUI.php
Looks like you would need to edit the default fieldSeparator in a couple of lines?
and
No guarantee that is going to work/not cause problems but you could try. Just keep a backup of the original file and remember that it will be overwritten if you regenerate an app.
Possibly easier and safer to just manually change the separator each time in the UI?
I think you will need to edit a core generated file, which of course presents problems of it's own when regenerating an app.
The function appears to managed in \resources\lib\CSVImportUI.php
Looks like you would need to edit the default fieldSeparator in a couple of lines?
Code: Select all
if(empty($tempRequest['fieldSeparator'])) $tempRequest['fieldSeparator'] = ',';
Code: Select all
// force default fieldSeparator, fieldWrapper if empty
if(!$j('#fieldSeparator').text().length) $j('#fieldSeparator').html(',');
Possibly easier and safer to just manually change the separator each time in the UI?
Re: Import CSV default coma to point-coma
Hi,
looking at the code, it seems that the value is hard coded currently. So you really need to modify the core file and be aware of your changes.
As peebee mentioned, look into resources\lib\CSVImportUI.php
and search for
Then replace the , with the ;
looking at the code, it seems that the value is hard coded currently. So you really need to modify the core file and be aware of your changes.
As peebee mentioned, look into resources\lib\CSVImportUI.php
and search for
Code: Select all
<div class="form-control-static" id="fieldSeparator" contenteditable>,</div>
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Import CSV default coma to point-coma
Hi,
thanks, in the meantime I've been snooping in the CSVimportUI file and I've made the change
Many thanks
thanks, in the meantime I've been snooping in the CSVimportUI file and I've made the change
Many thanks