I can accept some "reasonable" increase in time taken to get the correct results
This is my code, it works on 5970 lines out of 6000, but 30 lines happen to have exclamation marks that get lost.
Code: Select all
<%1 (
for /L %%j in (!LO!,1,!HI!) do (
SET "LN=" & SET /P "LN="
FOR /F "tokens=1* delims=]" %%a in ("!LN!") DO ECHO(%%b
)
) > %2
The intention is to accept file %1 with text such as
100265 101950 ]This user text is exciting ! This is Good.
and write to file %2 the original user text
This user text is exciting ! This is Good.
But the output is regrettably :-
This user text is exciting This is Good.
Is there any easy way to preserve any user text ! exclamations ?
I have control of the prefix such as
100265 101950 ]
This is always fixed width. It was needed for special sorting sequences.
After a good night's sleep I will try something like
Code: Select all
<%1 (
for /L %%j in (!LO!,1,!HI!) do (
SET "LN=" & SET /P "LN="
ECHO(!LN:~16!
)
) > %2
If that works then there could be a future maintenance problem if the sequence sorting should need 7 digit numbers,
in which case !LN:~16! might need changing to !LN:~18!
Sorting Prefix code is a few hundred lines away from this Prefix Stripping code,
so keeping two chunks of code "synchronized" could be a challenge

Regards
Alan