Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to export to Excel numbers as text fields?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg127136] Re: How to export to Excel numbers as text fields?
  • From: Dana DeLouis <dana01 at me.com>
  • Date: Mon, 2 Jul 2012 05:24:57 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hi.  I don't have my Windows version of MathM running.
If I remember correctly, and you don't get any better solutions...

v = {"+74951234567", "+74951234569", "+74951234575"};

Export["Testing123.CSV",  v]

In Excel,  on the Text Import Wizard, when you get to step 3, change the Column data format from General, to Text.
You are telling the program treat this column of data as text.   Otherwise, the program will try to  -- help you out --  by converting the data to numbers.

> In Excel I can set the cell format to "Text" and then
> entering +74951234567 without quotes will not result in converting it to
> number.

As a side note, without pre-formatting the cell, if you start with the single quote prefix character  '
then the program will interpret the entry as Text.   ie

'+7495

will enter this as text    +7495

The reason I mention this is that if you ever want to get fancy in the future, 
one can copy the Mathematica output cell.
In Excel, one can select a Cell, and then click an icon to run a macro.
Excel macros can read the ClipBoard, and parse the data to each Cell.
It's pretty neat if you want a simple Copy / Paste to Excel.

= = = = = = = = = =
HTH  :>)
Dana DeLouis
Mac & Math 8
= = = = = = = = = =




On Jun 29, 4:51 am, "Alexey Popkov" <lehi... at gmail.com> wrote:
> Hello,
> I have a list containing telephone numbers in the form "+74951234567" and I
> wish to export it to Excel without quotes preserving original appearance
> with the plus sign. In Excel I can set the cell format to "Text" and then
> entering +74951234567 without quotes will not result in converting it to
> number. Is it possible to force Export in Mathematica to create Text cells?
> 
> Thanks in advance.
> 
> Alexey





  • Prev by Date: Rewrite a Manipulate to call NDSolve just once?
  • Next by Date: Re: case of inconsistent API between Drop and Part?
  • Previous by thread: Rewrite a Manipulate to call NDSolve just once?
  • Next by thread: Re: multiplying, element wise, a row by each column of a matrix.