MathGroup Archive 2009

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

Search the Archive

Re: Filenames with ToString

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99947] Re: Filenames with ToString
  • From: dh <dh at metrohm.com>
  • Date: Wed, 20 May 2009 04:57:02 -0400 (EDT)
  • References: <guu2ef$67d$1@smc.vnet.net>


Hi Alain,

you string pattern is nuts.

""~~ .....

A string expression that starts with the empty string is superfluous.

ToString[NAME2]*".jpg"

* is the multiplication operator, hardly what you want.

What you want is e.g.:

ToString[NAME2]~~__~~".jpg"

This means: the string in NAME2, followed by any sequence of one or more 

characters, followed by ".jpg"

Daniel





Alain Mazure wrote:

> Hi again

> 

>    I have several files with extension .jpg of the type

> 

> "C1822_8_025_1.jpg", "C1822_8_025_2.jpg"

> "C1943_11_025_1.jpg", "C1943_11_025_2.jpg" .....

> 

> I know the first part of the name  which was given by : "" ~~ 

> ToString[NAME2]  with NAME2: C1822, C1943 ...

> 

> How to use FileNames in order to have, for a given NAME2 all the *.jpg 

> files in order to import them ?

> 

>    The command: FileNames["" ~~ ToString[NAME2]*".jpg"]  does not work

> 

>   Thanks !!!

> 

> 

> 

> 

> 

> 

> 





> 

> 

> Alain Mazure

> 

> Laboratoire d'Astrophysique de Marseille

> P=F4le de l'=C9toile Site de Ch=E2teau-Gombert

> 38, rue Fr=E9d=E9ric Joliot-Curie

> 13388 Marseille cedex 13, France

> 

> http://alain.mazure.free.fr/

> 

> Mails:

> alain.mazure at oamp.fr

> alain.mazure at free.fr

> 

> Phones:

> Lab: 33(0)491055902

> Mobile: 33(0)603556287

> Fax: 33(0)491661855

> SKYPE: MAZURE-ALAIN

> 




  • Prev by Date: Re: ColorFunction Range (Mathematica v7)
  • Next by Date: Re: Filenames with ToString
  • Previous by thread: Re: Filenames with ToString
  • Next by thread: Re: Filenames with ToString