Path: news.mathworks.com!not-for-mail
From: "Vadim Teverovsky" <vteverov@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Decimals from comma to dot
Date: Tue, 6 Jan 2009 08:05:30 -0500
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <gjvkur$glu$1@fred.mathworks.com>
References: <gjvfqq$muv$1@fred.mathworks.com>
Reply-To: "Vadim Teverovsky" <vteverov@mathworks.com>
NNTP-Posting-Host: teverovskyv.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1231247131 17086 144.212.105.97 (6 Jan 2009 13:05:31 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 6 Jan 2009 13:05:31 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:510007


Look up the help for the fopen command to see how to use that, then read in 
the string (fileread), then use strrep, followed by textscan.


"Fiona Buckley" <buckley_fiona@yahoo.com> wrote in message 
news:gjvfqq$muv$1@fred.mathworks.com...
> Hi,
> I've got a file in ASCII format with decimal values comma seperated and 
> columns are seperated by tab. The columns either have strings or floating 
> numbers and my first column is in a ISO time-date format.
> The file to be imported has column headers and titles which I don't need 
> however, I do need all the string data and the floating number data from 
> the general file.
>
> I want to write a script to import this data, but as the floating points 
> numbers are comma seperated I can't seem to manage. I previously wrote 
> scripts to do this but up to now my decimals were always dot seperated. No 
> matter what I do now I seem to be stuck. Here under some of the many 
> functions I tried and what happened:
> A) importdata  - gives me a strucutre with one data field and one textdata 
> field but almost all the strings have been trunckated and the numerical 
> values are combined (i.e. 3,34 6,91 9,32 gives me 3 346 91932)
> B) fopen - error message saying that the variable is undefined
> C) textscan or textread - error message as the data is not recognised
> D) strrep - I can't replace the string as I can't open the file
>
> Does anyone have an idea???
> Cheers
> Fiona