• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Copy a particular line of text file to a new file using...

Stats

  • Locked Locked
  • Replies 8
  • Subscribers 144
  • Views 17149
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Copy a particular line of text file to a new file using SKILL

jarilak
jarilak over 10 years ago

Hi....

I have one text file.From that file, i need to copy some set of lines to a new file.For this copying, i need to read each & every line of the text file and compare them with some reference lines.Is there any keywords or SKILL function available in SKILL.? Can anyone help me......?

Thanks & regards 

Jarilak.r

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Couldn't you just adapt my example then? Something like:

    pattern=pcreCompile("mt08m2_xx_mt08m2_un_mincoverage|mt08m1_xx_mt08m1_un_mincoverage|m1_to_m1|m2_to_m2")

    Or you could use something like:

    listOfRules=list("mt08m2_xx_mt08m2_un_mincoverage" "mt08m1_xx_mt08m1_un_mincoverage" "m1_to_m1" "m2_to_m2")
    inp=infile("./input.txt")
    outp=outfile("./output.txt")
    when(inp && outp
      while(gets(line inp)
        when(member(cadr(parseString(line)) listOfRules)
          fprintf(outp "%s" line)
        )
      )
      close(inp)
      close(outp)
    )

    This approach would assume that the second word on each input line has whitespace either side of it (so in your example text it omits m2_to_m2 because that has a "." immediately after m2_to_m2).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 10 years ago

    Couldn't you just adapt my example then? Something like:

    pattern=pcreCompile("mt08m2_xx_mt08m2_un_mincoverage|mt08m1_xx_mt08m1_un_mincoverage|m1_to_m1|m2_to_m2")

    Or you could use something like:

    listOfRules=list("mt08m2_xx_mt08m2_un_mincoverage" "mt08m1_xx_mt08m1_un_mincoverage" "m1_to_m1" "m2_to_m2")
    inp=infile("./input.txt")
    outp=outfile("./output.txt")
    when(inp && outp
      while(gets(line inp)
        when(member(cadr(parseString(line)) listOfRules)
          fprintf(outp "%s" line)
        )
      )
      close(inp)
      close(outp)
    )

    This approach would assume that the second word on each input line has whitespace either side of it (so in your example text it omits m2_to_m2 because that has a "." immediately after m2_to_m2).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information