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

MathGroup Archive 2012

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

Search the Archive

Re: creation of date list

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124772] Re: creation of date list
  • From: A Retey <awnl at gmx-topmail.de>
  • Date: Sun, 5 Feb 2012 06:01:58 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jgg1gp$bpp$1@smc.vnet.net>

Am 03.02.2012 08:14, schrieb shippee:
> I need to create a list of dates which runs from:
>
> 01/02/1901
> 01/03/1901
> 01/04/1901
> ...
> 12/11/1991
> 12/12/1991
> 12/13/1991
>
> but end up with a list of all those dates without the forward slash
> "/" - any thoughts on the best way to approach this with Mathematica?
> Please&  Thanks in advance.

I think you didn't manage to make clear which direction you actually 
want to go. Here are possibilities for either way:

list1 = StringSplit["01/02/1901
01/03/1901
01/04/1901
12/11/1991
12/12/1991
12/13/1991", "\n"]

list2 = StringReplace[list1, "/" -> ""]

list3 = StringReplace[list2,
   RegularExpression["([0-9]{2})([0-9]{2})([0-9]{4})"] -> "$1/$2/$3"]

hth,

albert



  • Prev by Date: Mathematica 8 - kernel hangs
  • Next by Date: Re: Filling area between curves
  • Previous by thread: Re: creation of date list
  • Next by thread: Re: creation of date list