Re: Export Data and Decimal Separator
- To: mathgroup at smc.vnet.net
- Subject: [mg125554] Re: Export Data and Decimal Separator
- From: Murray Eisenberg <murray at math.umass.edu>
- Date: Sun, 18 Mar 2012 02:47:02 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <jjrvbg$9h3$1@smc.vnet.net> <jjv8gt$phc$1@smc.vnet.net> <201203170752.CAA05132@smc.vnet.net>
- Reply-to: murray at math.umass.edu
How about using NumberForm and its option NumberPoint? (Sorry, I don't have the original post). On 3/17/12 3:52 AM, Norbert Marxer wrote: > On 16 Mrz., 12:34, Murta<rodrigomur... at gmail.com> wrote: >> Hi Bill, tks for your reply. >> I need comma for number decimal separator(10,1 instead of 10.1), your >> sugestion is for field separator. >> For Import command it works nice. >> Some idea? >> >> On Mar 15, 2:40 am, Bill Rowe<readn... at sbcglobal.net> wrote: >> >> >> >> >> >> >> >>> On 3/14/12 at 12:36 AM, rodrigomur... at gmail.com (Murta) wrote: >> >>>> I would like to know how could I export some data using comma as >>>> decimal separator. >>>> I tried this: data={{1.3,2.3},{3.2,4.3}} Export["file.txt", data, >>>> "TSV", {NumberPoint -> ","}] >>>> But didn't worked. Some idea? >> >>> "TSV" = tab separated values >>> "CSV" = comma separated values >> >>> Try that instead. That is >> >>> Export["file.txt", data, "CSV"] > > Hello > > You could define a function which converts your number to a string, > replaces the points with a comma, and maps this to all the numbers of > your table: > > mod := Map[StringReplace[ToString[ #], "." -> ","]&, #, {2}]&; > > You can test this with: > > data = {{1.3, 2.3}, {3.2, 4.3}}; > ExportString [mod[data], "TSV"] (*or*) > Export["test.txt", mod[data], "TSV"] > > Best Regards > Norbert Marxer > > -- Murray Eisenberg murray at math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
- References:
- Re: Export Data and Decimal Separator
- From: Norbert Marxer <marxer@mec.li>
- Re: Export Data and Decimal Separator