• 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. Skill to split a string with \t

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 144
  • Views 18878
  • 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

Skill to split a string with \t

Amos001
Amos001 over 6 years ago

Hi, 

I had below kinds of text file and tried to use skill to read this text file

143 95 47 46 94 142
141 93 45 44 92 140
139 91 43 42 90 138
137 89 41 40 88 136
135 87 39 38 86 134

Skil file to read text file

let((inPort nextLine)
inPort= infile("./instlist")
when(inPort
while(gets(nextLine inPort)
println(nextLine)
);while
close(inPort)
);when
);let

The CIW result is shown as below

"143\t95\t47\t46\t94\t142\n"
"141\t93\t45\t44\t92\t140\n"
"139\t91\t43\t42\t90\t138\n"
"137\t89\t41\t40\t88\t136\n"
"135\t87\t39\t38\t86\t134\n"

How can I get 143 95 47 46 without \t or \n? 

Many thanks and appreciate for your help.

  • Cancel
Parents
  • mschw
    mschw over 6 years ago

    Hi,

    you could split the lines with the command parseString, e.g.

    let((inPort nextLine)
     inPort= infile("./instlist")

     when(inPort

       while(gets(nextLine inPort)
        foreach(elem parseString(nextLine "\t\n")
         println(elem)
        )
       );while
       close(inPort)
       );when
    );let

    will print all individual elements of the file one by one in the CIW.

    Kind regards

    Matthias

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • mschw
    mschw over 6 years ago

    Hi,

    you could split the lines with the command parseString, e.g.

    let((inPort nextLine)
     inPort= infile("./instlist")

     when(inPort

       while(gets(nextLine inPort)
        foreach(elem parseString(nextLine "\t\n")
         println(elem)
        )
       );while
       close(inPort)
       );when
    );let

    will print all individual elements of the file one by one in the CIW.

    Kind regards

    Matthias

    • 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