Home > Community > Forums > PCB SKILL > find a string in a file

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: *

 find a string in a file 

Last post Tue, Jul 24 2007 7:37 AM by archive. 3 replies.
Started by archive 24 Jul 2007 07:37 AM. Topic has 3 replies and 1539 views
Page 1 of 1 (4 items)
Sort Posts:
  • Tue, Jul 24 2007 7:37 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    find a string in a file Reply

    Hello all again.
    I need to parse a big file to find a string. So I open it for reading (infile) and gets each line and compare it to my string... but it takes a quite long time..
    Is there a way to fo it faster? Is there a function to find a string in a file...
    Thanks.


    Originally posted in cdnusers.org by willbi
    • Post Points: 0
  • Tue, Jul 24 2007 1:41 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: find a string in a file Reply

    Hi,

    I suggest that you do this outside Skill. If using XP, try using the findstr command.
    eg:

    system("findstr Unison c:\\Cadence\\SPB_16.0\\Update.ini") returns 0 if the text is found, 1 if not.

    Cheers, Dave


    Originally posted in cdnusers.org by Dave Elder
    • Post Points: 0
  • Wed, Jul 25 2007 8:32 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: find a string in a file Reply

    I've found it handy to hand off certain functions such as text parsing to a PERL program from within SKILL and pick up the output from PERL and continue in the SKILL program.


    Originally posted in cdnusers.org by CDL
    • Post Points: 0
  • Fri, Jul 27 2007 6:57 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,950
    RE: find a string in a file Reply

    Hello all.
    Thanks Dave for your reply. I tried the way you suggest but the problem is that system procedure opens a visible command window under XP each time it is called.
    So it's not convenient.
    In fact, it seems to be long, so I added a form with informations changind according to what the process does and it now seems faster ;-)


    Originally posted in cdnusers.org by willbi
    • Post Points: 0
Page 1 of 1 (4 items)
Sort Posts:
Started by archive at 24 Jul 2007 07:37 AM. Topic has 3 replies.