how to read a spice nelist file(*.sp) and turn the schematic into a matrix?

J

jtan212

I am a c++ beginner. how can i read a *.sp file which discribe a
schematic file,including subcircuits,resistance, capacitance and
inductance, and then i need to turn the information i get to a matrix
of G,C,L.
Should i use struct lists ?how can i read a line and get the
element's two end's node information and parameter?from characters to
data?
Hoping someone to help me, thank u!
 
G

guyarad

wow, i'm not a C++ beginner and can't understand what you are trying to
do.
Let me try to:
You have a file in a specific format, and you want to read the
information from the file, parse according to the format, and than
store the information on the memory so you can use it in your program?
If that is thet case, you should read the file line by line using some
io functions, and than parse the string you have in your hand. that you
can do using scanf the its siblings.
Then you should figure the best way to represent the information. That
depends in what do you wanna do with it afterwards. So if you can,
please elaborate on the matter.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top