Home > Community > Forums > Custom IC SKILL > file handling

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 file handling 

Last post Thu, Sep 6 2012 10:48 AM by Andrew Beckett. 1 replies.
Started by Rojalin 06 Sep 2012 10:14 AM. Topic has 1 replies and 512 views
Page 1 of 1 (2 items)
Sort Posts:
  • Thu, Sep 6 2012 10:14 AM

    • Rojalin
    • Top 200 Contributor
    • Joined on Wed, Nov 30 2011
    • Posts 41
    • Points 775
    file handling Reply

    Hi,

    I have a file as below.

    <some liles> 

    (track

     (layer metal1

    width 0.1

    )

    (layer metal2

    width 0.2

    )

    (layer metal3

    width 0.3)

     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.

    Thanks 

     

    • Post Points: 20
  • Thu, Sep 6 2012 10:48 AM

    Re: file handling Reply

    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

    Regards,

    Andrew.

    • Post Points: 5
Page 1 of 1 (2 items)
Sort Posts:
Started by Rojalin at 06 Sep 2012 10:14 AM. Topic has 1 replies.