I would like a field to show only part of the filename

I would like a field to show only part of the filename

guilherme.lepinski.sc
Enthusiast Enthusiast
1,311 Views
6 Replies
Message 1 of 7

I would like a field to show only part of the filename

guilherme.lepinski.sc
Enthusiast
Enthusiast
Basically, we set up our file names with a _ at the end of the filename.

 

I want to create a field that only shows the content behind the _

 

for example -> ABC123ABC_0 / i would like it to show ABC123ABC

 

Remembering that our filenames have a standard number of characters. My codes are always going to change, the only  thing that remains a standard is _ separating the content, so i can't use the solution performed, e.g. here -> can-you-make-a-field-to-show-only-part-of-the-filename or here -> parsing-filename-into-individual-fields 

 

Appreciate any help

0 Likes
Accepted solutions (1)
1,312 Views
6 Replies
Replies (6)
Message 2 of 7

cadffm
Consultant
Consultant

Hi,

 

>>"I want to create a field that only shows the content behind the _"

is the opposite of

>>" i would like it to show ABC123ABC"

or?

So what do like to show, the first or the second part??

 

Your links shows both solutions

 

>>"Remembering that our filenames have a standard number of characters."

You mean the filename-length is always the same, for example 8 characters?

 

Sample: character1-6 = $(substr,$(getvar, dwgname),1,6)

Sample: character8 = $(substr,$(getvar, dwgname),8,1)

Sebastian

Message 3 of 7

cadffm
Consultant
Consultant
Accepted solution

If the character "_"  is not always in the same place and also not always in one of 2 or 3 specific places, and the number of places after the underscore can also be very different: mynameabcdefg_1, mynameabc_12, mynameab_12345678,...
then it doesn't work with diesel/lettering fields.

Sebastian

0 Likes
Message 4 of 7

guilherme.lepinski.sc
Enthusiast
Enthusiast
I understand, thank you very much!

*just for the record* I wrote wrong earlier in the sentence "Remembering that our filenames have a standard number of characters.", I forgot to write a "do not" there in the middle, correcting it would be "Remembering that our filenames DO NOT have a standard number of characters."

Sorry for the confusion 😛
0 Likes
Message 5 of 7

guilherme.lepinski.sc
Enthusiast
Enthusiast
btw, do you know a way to do that, even if not using diesel/lettering fields ?
0 Likes
Message 6 of 7

cadffm
Consultant
Consultant

The only way I know: A tool / program.

Nothing ootb

Sebastian

0 Likes
Message 7 of 7

ahmedA4UJR
Explorer
Explorer

I want take the filename field extracts the characters before the underscore (_). It can be work?
sample:

14126746-RS-RF-FX1011_Roof Plan.dwg
14126746-RS-L11-FX1009_Level 11.dwg
result:
14126746-RS-RF-FX1011
14126746-RS-L11-FX1009

0 Likes