I am using the Print commands to see what happens within the loop. I want to see the first word of each line and do more things on each loop iteration, but so far I get just get an error message like:
Part::partd: Part specification words[[1]] is longer than depth of object. >>
words[[1]]
Set::write: Tag Times in words {Vg,N001,0,15V} is Protected. >>
What am I doing wrong?
All the Procedure works well outside the loop, but not within the loop.
How should a check what is going on within the loop?
Although this always splits the string in four “words” (or at least this sees to me). And at one stage I want to read also the “ic=” word. Anyhow it looks also very easy. I will give a try as well to see what fits me best.
The table representations looks very informative (and clearly shows that it is Spice file )
Hi Stefan, you are right about it splitting into at most 4 words. I did that because I recognized the Spice format. Parsing that 4th word is more complicated. For example Pulse( . . . ) must be recognized as a source spec, with the required argument list, and can’t be just parsed at spaces until you’ve decided that the what is in ( . . ) is the argument list. Although you could eliminate the limit of 4 words, and then handle the split string. You could in fact add “(” and “)” to the list of delimiters and wind up with “Pulse” and 7 following arguments. (This is also a good example of a convenient truth: In Mathematica, there is almost always a better solution than a procedural loop.)