I have a file as below.
I want to read this file from the beginning.When it will find track word it should check for each layer.If layer is metal1 then execute the lines with in the braces for metal1.Similarly goes for other layers.
Kindly help me writing this code.
That's perfect for reading with lineread. If you have the file looking like this:
; some comments (track
(layer metal1 width 0.1)
(layer metal2 width 0.2)
(layer metal3 width 0.3))
) ; end of track
I can do:
data=lineread(port) ; first will return t because of the initial comment data=lineread(port) ; it will return a list with the contents the entire (track ...) list slurped in one go