Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Decimals from comma to dot
Date: Wed, 4 Mar 2009 16:20:17 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 21
Message-ID: <gom9o1$aib$1@fred.mathworks.com>
References: <gjvfqq$muv$1@fred.mathworks.com> <gk2tkh$64l$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1236183617 10827 172.30.248.38 (4 Mar 2009 16:20:17 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Mar 2009 16:20:17 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1740422
Xref: news.mathworks.com comp.soft-sys.matlab:522483



> One possibility is to run this function as a separate step. It doesn't work with comma separated files and it will replace commas in the header (if there is one) 
> / per
> 
> function    comma2point_overwrite( filespec )
> % replaces all occurences of comma (",") with point (".") in a text-file.
> % Note that the file is overwritten, which is the price for high speed.
>     file    = memmapfile( filespec, 'writable', true );
>     comma   = uint8(',');
>     point   = uint8('.');
>     file.Data( transpose( file.Data==comma) ) = point;
>     delete(file)
> end


Hi Per, thanks for this, I had exactly the same problem as Fiona. With this function I can now read in the .asc files without any problem using:

comma2point_overwrite( filespec )
[data] = importdata([filespec],'\t',headerlength);

You saved me (and surely others) from eternal hours of struggle! :-)