Re: Mathematica problem - generate filename automatically
- From: "Dave (from the UK)" <see-my-signature@xxxxxxxxxxxxx>
- Date: Thu, 20 Sep 2007 10:17:57 +0100
Bhuvanesh wrote:
Some variation of the following should do the trick:
In[1]:= ref = {"4A", "5C", "5D"};
In[2]:= freq = {"461", "767", "1234", "4554"};
In[3]:= n1 = {"00", "10", "20", "30", "40", "50", "60", "70", "80"};
In[4]:= n2 = {"10", "20", "30", "40", "50", "60", "70", "80", "90"};
I should have said, that n2 is always more 10 more than n1. This is relevant, as your solution generates names like 5Df4554l50u90.txt which implies data covers the range 50 to 90 degrees. In practice, that is not so.
In[5]:= filenames = Flatten[Outer[StringJoin[#1,"f",#2,"l",#3,"u",#4,".txt"]&, ref, freq, n1, n2], 3];
(* Check that we have the expected number of filenames *)
In[6]:= Length[filenames] == 3*4*9*9
Out[6]= True
(* Show the first few *)
In[7]:= Take[filenames, 3] //InputForm
Out[7]//InputForm=
{"4Af461l00u10.txt", "4Af461l00u20.txt", "4Af461l00u30.txt"}
After that,
Map[(data = Import[#, "Table"]; ListPlot[data, PlotLabel->#])&, filenames]
Is it possible for the PlotLabel to be a be a bit more sophisticated than simply the name of the file. I want a typical PlotLabel to be
"Ref 4A, 1234 MHz, 10\[Degree] to 20\[Degree]"
rather than the just the file name.
Bhuvanesh,
Wolfram Research
Thank you Bhuvanesh
P.S.: This question really should go to the Mathematica newsgroup (MathGroup): http://forums.wolfram.com/mathgroup
I am aware of that, but I have over the years become very disillusioned with that resource - in particular the moderated newsgroup comp.soft-sys.math.mathematica
i) Moderation means getting responses can be slow. I often find posting to newsgroups brings solutions in an hour or less, but its not unknown for one to have to wait ages for a post to appear if sent to comp.soft-sys.math.mathematica
This problem is probably somewhat worst for me, as I'm in Europe with a timezone very different from that of the moderator.
ii) Steve (the moderator) seems to object if I post from an obviously phony email address, despite the fact the question is sensible.
iii) Sending to the newsgroup sometimes results in one receiving a response directly from Wolfram Research before it even appears on the list. i.e. too much censorship I feel.
iv) Some things, which I feel would be useful, appear to be banned topics. This is as topic I posted some time back with the title "
University License fees are short sighted of Wolfram Research
http://groups.google.co.uk/group/sci.math.symbolic/tree/browse_frm/thread/a7777ed653566861
was not permitted. I posted it here, and got some useful feedback - not only on the newsgroup, but by private emails to/from Wolfram.
v) If one attempts to cross-post to sci.math.symbolic and comp.soft-sys.math.mathematica, then it does not appear on sci.math.symbolic until/if Steve permits it on comp.soft-sys.math.mathematica. That is the nature of how newsgroups work. So I dont even tend to cross post now.
Overall, I don't like the degree of censorship. There are Matlab and Maple newsgroups which are unmoderated and work well in my opinion.
--
Dave (from the UK)
Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@xxxxxxxxxxxx
Hitting reply will work for a few months only - later set it manually.
http://chessdb.sourceforge.net/ - a Free open-source Chess Database
.
- Follow-Ups:
- On comp.soft-sys.math.mathematica being moderated [Re: Mathematica problem - generate filename automatically]
- From: Daniel Lichtblau
- Re: Mathematica problem - generate filename automatically
- From: Jean-Marc Gulliet
- On Mathgroup. was: Re: Mathematica problem - generate filename automatically
- From: Nasser Abbasi
- On comp.soft-sys.math.mathematica being moderated [Re: Mathematica problem - generate filename automatically]
- References:
- Mathematica problem - generate filename automatically
- From: Dave (from the UK)
- Re: Mathematica problem - generate filename automatically
- From: Bhuvanesh
- Mathematica problem - generate filename automatically
- Prev by Date: Re: mupad / DifferentialGeometry
- Next by Date: On Mathgroup. was: Re: Mathematica problem - generate filename automatically
- Previous by thread: Re: Mathematica problem - generate filename automatically
- Next by thread: On Mathgroup. was: Re: Mathematica problem - generate filename automatically
- Index(es):
Relevant Pages
|