Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Literal double-quote -- how???

Apr
5
0
I need to delimit the fields of PDIR output with literal double-quotes, but I can't figure out how to escape the " so that it doesn't get consumed. I've tried doubling it, backslashing it, quoting it with back-quotes and single-quotes, but nothing works. I have to suppose that someone has done it successfully!
 
Delimit? Here's a start.
Code:
v:\> pdir /a:-d /(dy-m-d"^""th:m:s"^""f) *
2015-12-28"20:14:03"123.btm
2015-11-16"16:16:00"200mbits.rnd
2016-02-13"12:34:33"a b c.txt
<snip>

But it doesn't work as you might like with 'z' (size, a fixed-width field).
Code:
v:\> pdir /a:-d /(dy-m-d"^""th:m:s"^""z"^""f) *
2015-12-28"20:14:03"            477"123.btm
2015-11-16"16:16:00"      200000000"200mbits.rnd
2016-02-13"12:34:33"              0"a b c.txt
<snip>

And it doesn't seem to work very well if you want the file name ('f') anywhere but at the end.
 
Thanks! I tried the caret but must have broken something fooling around, because it didn't work for me. But now that I see that it does work, maybe I can force it to do what I need.
 
Rolling your own would probably be easier than struggling with PDIR (and probably work better too). Here's a simple example using an alias.
Code:
v:\> alias qpdir `do f in %$ ( echo "%f"%@filedate["%f"]"%@filetime["%f",,s]"%@filesize["%f"]" )`

v:\> qpdir a*
"a b c.txt"2016-02-13"12:34:33"0"
"agediff.btm"2015-11-15"13:17:51"203"
"allchars.btm"2015-05-18"15:26:08"612"
"anagram.exe"2013-08-23"22:40:33"61952"
"aslashb.txt"2015-11-25"22:26:30"5"
"att010416.xps"2016-01-04"15:37:16"120740"
"avtemp.btm"2015-11-08"13:39:32"1364"
"avtemp.btm.bak"2015-06-10"22:16:26"1386"

v:\> qpdir b*
"bat1.btm"2015-09-14"09:27:24"149"
"bday.btm"2015-04-21"10:55:24"413"
"bookstore.xml"2016-01-15"20:41:11"470"
 
Back
Top