MathGroup Archive 2001

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

Search the Archive

Re: integer to string??

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30949] Re: integer to string??
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Fri, 28 Sep 2001 03:54:57 -0400 (EDT)
  • References: <9ouhp1$1b5$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Richard,

i=1;
While[ i<4,
Print[ToExpression["file"<>ToString[i++]]]]

file1

file2

file3

The essential part is ToExpression["file"<>ToString[integer]]

--
Allan
---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565

"Richard" <wzn at jongnederland.nl> wrote in message
news:9ouhp1$1b5$1 at smc.vnet.net...
> Hi all,
>
> Is it possible to append an integer to a string? For example in a for-loop
> i'm trying to create the strings: file1, file2, file3, etc. How can I do
> this by appending a counter (i) to the string filee.
>
> Thanx !!,
> WJ
>
>
>
>
>




  • Prev by Date: Re: Re: ReadList, mix Words & Numbers?
  • Next by Date: Re: Mathematica as a word processor
  • Previous by thread: Re: integer to string??
  • Next by thread: RE: integer to string??