Literal double-quote -- how???

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Apr 3, 2013
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.
v:\> pdir /a:-d /(dy-m-d"^""th:m:s"^""f) *
2016-02-13"12:34:33"a b c.txt
But it doesn't work as you might like with 'z' (size, a fixed-width field).
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
And it doesn't seem to work very well if you want the file name ('f') anywhere but at the end.
Apr 3, 2013
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.
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"

v:\> qpdir b*