Reading an Excel File (Excelfinlename.dvd) with decimal comma instaed of decimal point?

Asked by Aubai on 31 Jul 2013 at 8:15
Latest activity Commented on by per isakson about 8 hours ago

Hi..., Currently i am trying to read an excel files with two different ending . dvd & .sod (From SCADA system). i am using the [Values] = xlsread(File_to_Open) to do so. my question is: In the excel file i have the values so written (Example: 21,1) with comma not point (I am using a German Windows system) and when i am importing those data to matlab i am getting something like 37, I am not sure why!! Can you help me with this problem of importing when using the xlsread() function?

2 Comments

Aubai on 31 Jul 2013 at 14:31

Any suggestion will be welcomed :)

Jan Simon on 31 Jul 2013 at 15:02

I've enabled the decimal dot on my German system to avoid such troubles.

Aubai

Tags

Products

2 Answers

Answer by Aubai about 13 hours ago
Accepted answer

it seems i had the solution all along. I took the third output of xlsread and then change it from cell to matrix using cell2mat and i got me wished output thx for the help anyway :)

0 Comments

Aubai
Answer by per isakson on 31 Jul 2013 at 14:51
Edited by per isakson about 8 hours ago

I don't recognize these extensions. I assume they are text.

Here are two files, which replace comma by dot. Pick one. Please, make copies of your files before you try these functions.

    function fread_( strInFileSpec, strOutFileSpec )
        fid = fopen( strInFileSpec, 'r' );  
        str = fread( fid, inf, '*char' );  
        fclose( fid );
        str = strrep( str', '.', ',' );
        fid = fopen( strOutFileSpec, 'w' );
        fwrite( fid, str, 'char' );
        fclose( fid );
    end 
    function memmap_( strInFileSpec )
        file    = memmapfile( strInFileSpec, 'writable', true );
        comma   = uint8(',');
        point   = uint8('.');
        file.Data(( file.Data==comma)' ) = point;
    ... delete(file)
    end

2 Comments

Aubai about 13 hours ago

unfortunately that did not work. i am becoming an empty file afterword. Any other suggestion would be appreciated :)

per isakson about 8 hours ago

Neither .dvd nor .sod is included in this list: File formats that are supported in Excel

per isakson

Contact us