Hope this hasn't been posted previously, if so can someone direct me to it.
Can a custom column be made to give you the file name character count (with or without the file extension)?
Custom Columns File Name Character Count
-
Marco
- Posts: 2354
- Joined: 27 Jun 2011 15:20
Re: Custom Columns File Name Character Count
You mean that, giventhe output should be 4?
Code: Select all
C:\folder\file.txtTag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]
Don sees all [cit. from viewtopic.php?p=124094#p124094]
-
dennydraco
- Posts: 7
- Joined: 25 Jul 2014 16:20
Re: Custom Columns File Name Character Count
yes, exactly
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Custom Columns File Name Character Count
enter ::snippet; in addressbar and paste this code to create the column definition as NameLen.
[/size]It's return value is like this: <length of name with ext>/<length of name without ext>
If you don't want it to apply to folders, then select "Files" as the coulmns itemtype.Also in this case, the script may be highly simplified.
Code: Select all
Snip: CustomColumn 1
XYplorer 14.30.0301, 7/25/2014 8:42:13 PM
Action
ConfigureColumn
Caption
NameLen
Type
3
Definition
$n = strlen(<cc_name>);
if <cc_ext> != '' {$r = "/".($n - strlen(<cc_ext>) -1);}
else {$r = "/".$n;}
return $n$r;
Format
0
Trigger
1
Item Type
2
Item Filter
If you don't want it to apply to folders, then select "Files" as the coulmns itemtype.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
dennydraco
- Posts: 7
- Joined: 25 Jul 2014 16:20
Re: Custom Columns File Name Character Count
Thanks for the script. That's what I needed. 
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Custom Columns File Name Character Count
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
XYplorer Beta Club