John Stockton
2021-08-21 12:15:13 UTC
I enter "z filename" on lower case on the Command Line, and there should be a file "FILENAME.TXT" for "Z.BAT" to use - OK so far.
But I want to use "FILENAME", not "filename", within the Batch file, so that files created by the Batch have using the case of the first part of the .TXT file.
I do this with
:: Copy %1 as FILENAME case into %ZQ%
@dir /b %1.TXT | COLS '@SET * 'ZQ= 1-8 > ZQ.BAT & call ZQ.BAT & del ZQ.BAT
in which COLS.EXE is something I wrote long ago (' starts a space-less string, * gives a space, 1-8 gives that range of the piped input]. %1 is not used after that; %ZQ% is used instead.
Is there a better way of doing it, preferably in pure Batch - I know I could use MiniTrue instead?
The above relies on the case of "FILENAME", which is best for me; but, for interest, could one force upper-case?
But I want to use "FILENAME", not "filename", within the Batch file, so that files created by the Batch have using the case of the first part of the .TXT file.
I do this with
:: Copy %1 as FILENAME case into %ZQ%
@dir /b %1.TXT | COLS '@SET * 'ZQ= 1-8 > ZQ.BAT & call ZQ.BAT & del ZQ.BAT
in which COLS.EXE is something I wrote long ago (' starts a space-less string, * gives a space, 1-8 gives that range of the piped input]. %1 is not used after that; %ZQ% is used instead.
Is there a better way of doing it, preferably in pure Batch - I know I could use MiniTrue instead?
The above relies on the case of "FILENAME", which is best for me; but, for interest, could one force upper-case?
--
(c) John Stockton, near London, UK. Using Google Groups. |
Mail: J.R.""""""""@physics.org - or as Reply-To, if any. |
(c) John Stockton, near London, UK. Using Google Groups. |
Mail: J.R.""""""""@physics.org - or as Reply-To, if any. |