Jump to content
Sign in to follow this  
Travis_M

diesel expression help

Recommended Posts

Travis_M

Looking to create a diesel expression for a file name in order to display just the first 10 spaces. the file names vary in length so a "set" standard of subtracting will not work for me. 

ex. mem-eng-001 cabinet bom.dwg

      mem-eng-002 XXX view for cabinet 03 topdown view.dwg

the current expression I am trying to get to work is 

$(substr,$(getvar,"dwgname"),1,$(-,$(strlen,$(getvar,"dwgname")),4))
I figure it is either something simple I am just not seeing or it is something else entirely. so any help that can be provided is appreciated. 

Share this post


Link to post
Share on other sites
steven-g
2 hours ago, Travis_M said:

Looking to create a diesel expression for a file name in order to display just the first 10 spaces.

 

 

Substr

Returns the substring of string , starting at character start and extending for length characters.

$(substr, string, start [, length])

Characters in the string are numbered from 1. If length is omitted, it returns the entire remaining length of the string.

$(substr,$(getvar,"dwgname"),1,10)
  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...