- May
- 13,828
- 211
I want to 0-pad months and days in the likes of m/d/yyyy (as is output by the ancient DUMPEL.EXE). TPIPE can do that.
That is: pad a single digit between BOL and a forward slash, then pad a single digit between two forward slashes.
But it behaves differently if I put theTPIPE command into an alias.
In this case, TPIPE seems to be ignoring the first '/' in the search criterion, "/(\d)/", of the second replacement.
Are there any conjectures on why this happens and/or how to fix it?
Code:
v:\> echo 1/1/2020 1/2 | tpipe /replace=4,0,0,0,0,0,0,0,0,"^(\d)/",0$1/ /replace=4,0,0,0,0,0,0,0,0,"/(\d)/","/0$1/"
01/01/2020 1/2
That is: pad a single digit between BOL and a forward slash, then pad a single digit between two forward slashes.
But it behaves differently if I put theTPIPE command into an alias.
Code:
v:\> alias fixdates `tpipe /replace=4,0,0,0,0,0,0,0,0,"^(\d)/",0$1/ /replace=4,0,0,0,0,0,0,0,0,"/(\d)/","/0$1/"`
v:\> echo 1/1/2020 1/2 | fixdates
01/01/2020 01/2
In this case, TPIPE seems to be ignoring the first '/' in the search criterion, "/(\d)/", of the second replacement.
Are there any conjectures on why this happens and/or how to fix it?