Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #15585

Re: small string issue

From "Brambilla Roberto Luigi (RSE)" <Roberto.Brambilla@rse-web.it>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: small string issue
Date 2013-10-04 02:09 +0000
Message-ID <l2l7vs$4vh$1@smc.vnet.net> (permalink)
References <20131003043519.E79496A80@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


May be this procedure help

c1 = ToString[unasfechas]];
c2 = ToCharacterCode[c1];
c3 = Drop[c2, 2]; (*remove first 2 char*)
c4 = Drop[c3, -1]; (*remove last char*)
c5 = DeleteCases[c4, 44]; (*remove commas*)
c6 = DeleteCases[c5, 32];  (*remove spaces*)
c7 = Partition[c6, 10];
c8 = FromCharacterCode[c7];

c8 // TableForm
c8//Length

Bye rob


-----Messaggio originale-----
Da: Francisco Gutierrez [mailto:fgutiers2002@yahoo.com] 
Inviato: gioved=EC 3 ottobre 2013 06:35
A: mathgroup@smc.vnet.net
Oggetto: small string issue

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
Thanks
Francisco

RSE SpA ha adottato il Modello Organizzativo ai sensi del D.Lgs.231/2001, inforza del quale l'assunzione di obbligazioni da parte della Societ=E0 avviene con firma di un procuratore, munito di idonei poteri.
RSE adopts a Compliance Programme under the Italian Law (D.Lgs.231/2001). According to this RSE Compliance Programme, any commitment of RSE is taken by the signature of one Representative granted by a proper Power of Attorney.  Le informazioni contenute in questo messaggio di posta elettronica sono riservate e confidenziali e ne e' vietata la diffusione in qualsiasi modo o forma. Qualora Lei non fosse la persona destinataria del presente messaggio, Lainvitiamo a non diffonderlo e ad eliminarlo, dandone gentilmente comunicazione al mittente. The information included in this e-mail and any attachments are confidential and may also be privileged. If you are not the correct recipient, you are kindly requested to notify the sender immediately, to cancel it and not to disclose the contents to any other person.

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: small string issue "Brambilla Roberto Luigi (RSE)" <Roberto.Brambilla@rse-web.it> - 2013-10-04 02:09 +0000

csiph-web