If you try to import an ASCII file, as numeric data, that uses comma as the decimal separator SciDAVis will not read correctly the values (will read as zero), unless you define the decimal separator as comma in Edit -> Preferences -> General -> Numeric format
E.g:
The file to be imported contains:
1,00 1
2,00 2
3,00 3
4,00 4
5 5
The data will appear in the table as:
0 1
0 2
0 3
0 4
5 5
When the correct should be:
1 1
2 2
3 3
4 4
5 5
This occurs even if you choose the appropriated decimal separator (1.000,0 or 1 000,0) in the import dialog.
Steps to reproduce the bug (using the attached file):
- Go to Edit -> Preferences -> General -> Numeric format, and set the decimal separator as 1,000.0 (the default option)
- Go to File -> import ASCII and:
-- Check the 'Numeric data' checkbox
-- Change the 'Decimal Separators' to 1.000,0 (or 1 000,0)
-- Select a file that contains numbers using comma as decimal separators
-- Click the 'Open' button -> the numbers with comma as decimal separators will appear as zero in the table
This bug was verified in SciDAVis 1.14, under Slackware Linux, and in SciDAVis 1.D13, running on WINE.
Try attached patch
Hi Miquel.
The patch does not work for me.
Last edit: Fellype 2019-08-21
Fellype,
The patch works for me in a Qt5.12.4-python-3.7.4 build
It works partially in a Qt4.8.7-python-2.7.16 build.
Partially means it works for importing into new Table, not for Overwrite current table.
I assume that you use Qt4-python2.
Can you check if the patch works for importing into new Tables?
Yes, this is my config.
Sorry for my previous report... I tried to import an ascii file using the importASCII python command.. In that case the cells are filled with ' - ' instead of zeros for the numbers with comas.
Running new tests using the import ASCII dialog:
Importing to a new table works as expected if the appropriated decimal separator (' , ') is chosen. But not if decimal separators remain the default (' . ') - the zeros appear in the cells in this case.
Importing to an existing table does not work even if the decimal separator are appropriated: the table remains empty. The same for the options to import to new columns or rows.
I believe the problem originally reported is solved ... But we ended up finding others.
I'll be out for 10 days, but I can examine the other bugs and create reports after that.
Please check if attached patch fixes the bug also for Qt4-python2
Miquel,
Using the last patch all import options in the importASCII dialog work fine - new table, new columns/rows and overwrite existing table.
Good job and thank you for the effort in solve the issue.
fixed here