• 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. Allegro X PCB Editor
  3. ParseString Output Format

Stats

  • Replies 3
  • Subscribers 160
  • Views 13576
  • Members are here 0
More Content

ParseString Output Format

LP2R4T
LP2R4T over 14 years ago

Hi,

Can someone help me with this request? 

I want to get the following result  "44.44 55.55 66.66 77.77" but I get this one instead " \"44.44 55.55 66.66 77.77\"\n"

***The input:***
space_1_x_space: "44.44 55.55 66.66 77.77"
space_1_y_space: 0.0

***The Program:***
while( gets(inLine inPort)
 inList=parseString(inLine ":" )
 mem1=car( inList)
 mem2=cadr( inList)
 
 case( mem1
     ("space_1_x_space" space_1_x_t = mem2
  outPort=outfile( "Report")
  fprintf( outPort "%L" space_1_x_t)

Thanks in advance 

 

  • Sign in to reply
  • Cancel
  • Charlie Davies
    Charlie Davies over 14 years ago
    Change your %L to %s.

    Regards,
    Charlie
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • oldmouldy
    oldmouldy over 14 years ago

    Your "Break Character" for the parseString is the ":" character, the string "space_1_x_space" preceeds it and the " \"44.44 etc succeeds it. The space and double quote are part of the resulting string, hence the " \"44.44 etc and the \"\n" at the end. You could try changing the case test to include the ":" and trailing space and set the Break Character to "\"" - you need the "\" to "escape" the double quote; or have parseString run again on the mem2 variable with "\"" as the Break Character, that should get the "car" set to the desired string.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • LP2R4T
    LP2R4T over 14 years ago

    Thanks a lot for your help

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

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