From: Jean on
Hi all

I have to upload a very heavy data file for which the numbers are defined using "," as decimal separator.
Is there anyway to import easily into matlab?

Thank you very much

Jean
From: us on
"Jean " <ptitjeannot(a)hotmail.com> wrote in message <hjubfb$mri$1(a)fred.mathworks.com>...
> Hi all
>
> I have to upload a very heavy data file for which the numbers are defined using "," as decimal separator.
> Is there anyway to import easily into matlab?
>
> Thank you very much
>
> Jean

this has been discussed over and over in this NG; and many solutions have been provided...

us
From: Rune Allnor on
On 29 Jan, 10:58, "Jean " <ptitjean...(a)hotmail.com> wrote:
> Hi all
>
> I have to upload a very heavy data file for which the numbers are defined using "," as decimal separator.
> Is there anyway to import easily into matlab?

First of all: Get whoever generated or saved those
data to use a different locale, and select one that
uses the point as decimal separator.

Second, if the file uses *only* commas as field
separator as well, you are screwed. There is no way
you can decide if one particular comma plays the part
of a decimal separator or a field separator.

Third, get whoever generated or saved those
data to use a different locale, and select one that
uses the point as decimal separator.

Fourth, if the field separator is something else than
*only* a comma, e.g. ', ' (comma + space), you can use
a regular expression to replace only the commas that
are surrounded by two digits with dots.

Sixth get whoever generated or saved those
data to use a different locale, and select one that
uses the point as decimal separator.

Seventh, if the field separator includes no commas at all,
you can use a simple search and replace to replace all
commas with dots.

Eigth, get whoever generated or saved those
data to use a different locale, and select one that
uses the point as decimal separator.

Ah, yes. Did I mention that you should get whoever
generated or saved those data to use a different locale,
and select one that uses the point as decimal separator?

Rune
From: Pekka Kumpulainen on
"Jean " <ptitjeannot(a)hotmail.com> wrote in message <hjubfb$mri$1(a)fred.mathworks.com>...
> Hi all
>
> I have to upload a very heavy data file for which the numbers are defined using "," as decimal separator.
> Is there anyway to import easily into matlab?
>
> Thank you very much
>
> Jean

If the field separator happens to be something else than comma you can replace the commas , with periods. If the data file happens to be otherwise nicely formatted you might be able to use load to read in in.
Take a look at function replaceinfile in the File Exchange for the replace part.