Re: forming filename string
- To: mathgroup at smc.vnet.net
- Subject: [mg84057] Re: forming filename string
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 7 Dec 2007 06:57:17 -0500 (EST)
- Organization: Uni Leipzig
- References: <fjavqr$ru4$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, you should increase the number of backslashes -- only \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ will be a single valid backslash ;-) or may Do[infile="U:/data/file"<>ToString[i]<>".nb"; outfile="U:/datao/file"<>ToString[i]<>".tex"; x=Import[infile];Export[outfile,x];,{i,0,10,1}] Regards Jens help ?? man_koshi wrote: > Hi, I am new to mathematica, and I just wanted to Import some of .nb files into it, and then export it into different format. I can do it one by one, but I want to form varying 'filename'. Can you check what's wrong with it. > > Do[infile=StringForm["\"U:\\\\data\\\\file``.nb\"",i]; outfile=StringForm["\"U:\\\\datao\\\\file``.tex\"",i]; x=Import[infile];Export[outfile,x];,{i,0,10,1}] > > I am getting errors like: > > Import::chtype: First argument "U:\\data\\file0.nb" > is not a valid file, directory, or URL specification. > > Export::chtype: First argument "U:\\datao\\file0.tex" is not a valid file specification. > > BUT IF I DO: > Import["U:\\data\\file0.nb"] it works! so is not an invalid file address. I guess there is some requirement for filename string?? > > Please help. >