Re: File names and strings
- To: mathgroup at smc.vnet.net
- Subject: [mg110958] Re: File names and strings
- From: David Bailey <dave at removedbailey.co.uk>
- Date: Wed, 14 Jul 2010 05:35:34 -0400 (EDT)
- References: <i1hbiv$689$1@smc.vnet.net>
On 13/07/10 10:27, S. B. Gray wrote: > > In[867]:= num = 6; > FileNames["Link*-n="<> "06"] (* Can't I use<> here? *) The asterisk stands for zero or more characters. You should have used FileNames["Link*-n="<> "06*"] since none of your file names ended in 06. > In[861]:= num=6; > numstr=If[num<10, numstr="0"<>ToString[num], > numstr = ToString[num]] > FileNames["Link*"<> ToString[numstr]] (* No good also. ?? *) Again, this failed for the same reason. Note also, that you really should decide if you are setting numstr inside the body of the If or outside it! Note also that from experiment, it would seem that you can use "abbreviated patterns" - i.e. the asterisk, or string expressions (~~), but you can't mix the two. David Bailey http://www/dbaileyconsultancy.co.uk