Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

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

Search the Archive

Re: small string issue

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131785] Re: small string issue
  • From: Joe Gwinn <joegwinn at comcast.net>
  • Date: Thu, 3 Oct 2013 22:26:23 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • References: <l2iq4j$qmj$1@smc.vnet.net>

In article <l2iq4j$qmj$1 at smc.vnet.net>, Francisco Gutierrez
<fgutiers2002 at yahoo.com> wrote:

> Dear group:
> 
> I am importing into Mathematica a big number of dates. For example:
> 
> 
> unasfechas = {11/06/1998, 21/01/2010, 12/10/2001, 20/07/2009, 
>   02/02/2002, 02/01/2004, 19/11/2001, 14/02/2010, 26/12/2009, 
>   20/10/1996, 09/07/2006, 01/01/1997, 30/08/1998, 15/02/2006, 
>   13/12/2009, 25/09/2002, 29/06/2009, 02/04/2010, 22/02/2001, 
>   01/04/2010}
> 
> 
> These dates come from Excel files, and are brought into Mathematica not as
> strings but as numbers. I want to transform them into strings to
> be able to apply functions like DateList, etc.
> 
> In principle, this should be easy. This example, taken from the
> documentation, is simple and clear:
> ToString[x^2, InputForm]
> 
> 
> 
> Which returns a workable string.
> 
> However:
> ToString[unasfechas[[1]], InputForm]
> 
> 
> returns 
> 11/11988
> 
> also a string but after applying an operation to what it considers the denominator.
> 
> how should I proceed

It may be simpler to use the Excel date numbers and convert into the
corresponding numbers in Mathematica.  How Excel encodes dates is explained in
the Excel documentation.  Likewise Mathematica.

Joe Gwinn



  • Prev by Date: Re: small string issue
  • Next by Date: Re: Output display by slide
  • Previous by thread: Re: small string issue
  • Next by thread: Re: small string issue