• 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. Getting file name from a port

Stats

  • Replies 3
  • Subscribers 158
  • Views 13050
  • Members are here 0
More Content

Getting file name from a port

Pawandeep
Pawandeep over 12 years ago
Hi,

Is there any function for getting the file name of a port?

Say if I want to get the “test.xls” from the below port.

inPort = infile(“C:\test\test.xls”)

Thanks,

Pawan
  • Sign in to reply
  • Cancel
  • eDave
    eDave over 12 years ago
    get_filename(inPort)
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Tyler
    Tyler over 12 years ago

    You can use get_filename(<port>) to get the full path for the port as a string. This can be passed to axlDMFileParts() to get the different portions, such as the directory, file name, file name with extension, or just file extension. Since you seem to want the file with extension, you would want the third element in the list returned from axlDMFileParts().  

    Regards,
    - Tyler 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Pawandeep
    Pawandeep over 12 years ago
    Hi Tyler/Dave,

    Below works very well.

    axlDMFileParts(get_filename(inPort))

    Thanks,

    Pawan
    • 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