pdir function usage

Apr 1, 2013
22
0
Trying to understand how to use 'function' as in pdir c:\*.*/s/a: /(zk dd/m/yt fpn a]) /[s50000,]

Works ok, biut I'd like to display the file's attributes w/o the _ characters so want to use replace function to zap the _s i a, so tried @replace[_,,a] in place of the a above, as I _think_ the help says - it gives the example using md5- but no luck.

Also tried %@replace , %%@replace %%a - still no luck. Anyone know the secret?

Or does function only work with filename?

Same problem in 4nt8 and tcc 13 so not a pdir fault as such, hust that help isn't v helpful

TIA John
 
May 20, 2008
3,515
4
Elkridge, MD, USA
a is the code to reprot attributes. As described in the HELP the command below will do what you want:

pdir /s/a: /(zk dd/m/yt fpn @strip[_,%%@attrib[*]]) /[s50000] c:\*.*

Notes:
1/ @STRIP is simpler than @REPLACE
2/ the trailing comma for the size range is unnecessary
3/ all options SHOULD precede the file selection, otherwise the parser usually, but not always can figure out what you want
4/ is the letter t following the file date intentional?
5/ personally I like my listings to look like tables; putting anything after variable width filed destroys vertical alignment, but so does the variable-width attribute field created by @STRIP. You may consider using @REPLACE with a space character to replace the underscore: @replace[_, ,%%@attrib[*]]
--
HTH, Steve
 
Apr 1, 2013
22
0
Thanks- that's fixed! + see below

btw1, is there a way to get the total size of the files > 50000 by adding a func eg @eval[%siz+%%@filesize[*]] but I can't see how to do this w/o adding up 1st col in file externally

btw2, the help for pdir in my (free!) tcc 13 when I do 'help pdir' is limited to the 1st page ie the rh pane doesn't scroll down & so doesn't have all the stuff in the 4nt 8 version re usage - is this intended?
-----
a is the code to reprot attributes.
Yes - dohhhh- should've thought that is wasn't a variable.

As described in the HELP the command below will do what you want:
Not described v well imo in help - eg no example lots of stuff about function 1 func 2, internal external! An example just like yours would've clarified.

pdir /s/a: /(zk dd/m/yt fpn @strip[_,%%@attrib[*]]) /[s50000] c:\*.*

4/ is the letter t following the file date intentional?
file time

John
 
May 20, 2008
3,515
4
Elkridge, MD, USA
BTW1: use the /M option
BTW2: recently prepared HELP versions have problems scrolling - you may need to use the scroll wheel (if you have one), or even the scroll bar on the far right of the HELP window. My version's CRC32 is 7B32CBDC. If your's is different, you may need to download it again.
.
 
Similar threads
Thread starter Title Forum Replies Date
vefatica WAD Nested variable expansion in PDIR's @function[*]? Support 13
Phileosophos PDIR to list filenames without extensions? Support 2
vefatica PDIR and streams Support 1
vefatica PDIR with fixed-width unqualified filename? Support 2
W pdir returns diff results between tcc and tcmd - one is an error msg Support 5
thedave pdir /s Support 2
Emilio III pdir /f switch Support 1
D pdir ignores pm Support 2
WadeHatler pdir broken in 19.1 for directories with spaces Support 1
M WAD PDir not working correctly... Support 5
mfarah More on pdir's options: /(fq) Support 5
mfarah How to? Getting pdir to display relative paths. Support 2
S PDIR and @LABEL questions Support 4
M How to? PDir on multiple wildcard patterns... Support 2
T How to? dir/pdir - 2nd level down only Support 7
JohnQSmith PDIR and descriptions Support 21
G WAD PDIR @IF bug, @WORD bug Support 8
S WAD PDIR: files with percent sign % in name cause not listing other files in directory Support 9
S WAD PDIR ignores exclusion ranges Support 1
M PDir format question... Support 3
M How to? "PDir" not working the way the I _thought _ the documentation said it does… Support 8
S WAD /Sn mishandled in DIR and PDIR, possibly elsewhere Support 15
S Fixed GPF in PDIR Support 3
S PDIR issue Support 1
M PDir causing Take Command/TCC to crash... Support 6
M A "PDir" issue... Support 16
M A simple question related to the "dir" (and "pdir") commands... Support 5
J pdir /b1 issue Support 20
M Missing PDir option... Support 5
J Maybe Not So Hard Pdir Question Support 1
S PDIR fails in 12.10.55 Support 3
J V12 PDIR failure Support 1
S PDIR command causes GPF Support 5
D pdir inconsistency Support 4
S PDIR has trouble processing filenames with embedded percent sign Support 3
P PDIR woes Support 0
gschizas pdir crashes horribly in one specific folder Support 5
S PDIR question Support 2
S pdir /(fq) not working Support 5
R Colored directory listing bug with pdir. Support 1
nickles Bias in PDIR Support 5
F pdir problem Support 3
D can PDIR list full filepaths of docs in a nested folder? Support 13
vefatica Documentation Function parameters Support 0
Jay Sage Documentation Function @DRIVE Missing in Help Lists Support 0
Joe Caverly How to? Get name of current LIBRARY function? Support 4
x13 WeekNum function? Support 3
Joe Caverly No blank line in TEXT...ENDTEXT in a LIBRARY function Support 8
cgunhouse Ctrl-C from within a library function Support 6
C email[string] function Support 10

Similar threads