Search found 2191 matches

by dbenham
25 May 2019 00:35
Forum: DOS Batch Forum
Topic: Safely parse nearly any CSV with parseCSV.bat v1.3
Replies: 9
Views: 8506

Re: Safely parse nearly any CSV with parseCSV.bat

OMG :shock: :oops:

I had a nasty bug in version 1.2 that prevented the /D option from working if /E was also used.

I updated the version to 1.3 in the first post of this thread.


Dave Benham
by dbenham
19 May 2019 20:21
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.1 - regex text processor with support for text highlighting and alternate character sets
Replies: 406
Views: 166262

Re: JREPL.BAT v8.1 - regex text processor with support for text highlighting and alternate character sets

Steffen (aGerman) discovered how to enable the ANSI escape sequences without resorting to modifying the registry. See series of posts starting at https://www.dostips.com/forum/viewtopic.php?f=3&t=9144&p=59700#p59691 This is useful for the new /H option. Here is version 8.1 JREPL8.1.zip Summary of Ch...
by dbenham
19 May 2019 19:33
Forum: DOS Batch Forum
Topic: Enable ANSI escape sequence within Windows 10 console
Replies: 7
Views: 233

Re: Enable ANSI escape sequence within Windows 10 console

This is much faster :!: I can't really tell. The first time I launch PowerShell within a given cmd.exe process, it is always S... L... O.... W....... Thereafter it is relatively fast. Unfortunately it doesn't work using cmd.exe which would have been even faster. The cmd seems to reset VT processing...
by dbenham
16 May 2019 11:08
Forum: DOS Batch Forum
Topic: Enable ANSI escape sequence within Windows 10 console
Replies: 7
Views: 233

Re: Enable ANSI escape sequence within Windows 10 console

Very cool 8) But yes, slow. Even so, I think it may be worth adding as an additional option. Maybe /VT to enable the escape sequences, for those that are desperate for the feature and willing to wait for the slow initialization. JREPL already has significant startup time, and as you have it, there i...
by dbenham
15 May 2019 12:22
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.1 - regex text processor with support for text highlighting and alternate character sets
Replies: 406
Views: 166262

Re: JREPL.BAT 8.0 - regex text processor with support for text highlighting and alternate character sets

Once I learned how to configure the Windows 10 console to support ANSI escape sequences , I created a new JREPL version that supports highlighting of matched or replaced text. Here is version 8.0 JREPL8.0.zip Summary of Changes C:\>jrepl /?history 2019-05-15 v8.0: Add /Hxxx options for highlighting ...
by dbenham
15 May 2019 10:57
Forum: DOS Batch Forum
Topic: Enable ANSI escape sequence within Windows 10 console
Replies: 7
Views: 233

Enable ANSI escape sequence within Windows 10 console

Starting with Windows 10, the console supports ANSI escape sequences, but only if the console is configured to NOT "use legacy console", and the program writing to the console must configure its output to interpret the sequences. CMD.EXE was modified such that its internal commands do support the AN...
by dbenham
14 May 2019 10:43
Forum: DOS Batch Forum
Topic: Wait till close by title
Replies: 2
Views: 90

Re: Wait till close by title

Ooh - a bit of snark from aGerman... finally :!: :lol:
and well said.
by dbenham
07 May 2019 05:38
Forum: DOS Batch Forum
Topic: command prompt in windows 10
Replies: 31
Views: 9432

Re: command prompt in windows 10

Thanks npocmaka_ I did a Google search and discovered a new Microsoft GitHub Windows Terminal project that includes source code for both the old console as well as the new Windows terminal. Best of all, Windows is encouraging community participation in developing new features :!: Also within I found...
by dbenham
06 May 2019 12:22
Forum: DOS Batch Forum
Topic: Successfully escape a token delimiter in a fully qualified command path!
Replies: 6
Views: 161

Re: Successfully escape a token delimiter in a fully qualified command path!

I tested the behaviour described by Dave. c:\temp\with^ space.bat - WORKS \temp\with^ space.bat - FAILS with^ space.bat - FAILS But only when you try it from the command line :!: Tested in a batch file the results are different c:\temp\with^ space.bat - WORKS \temp\with^ space.bat - WORKS with^ spa...
by dbenham
05 May 2019 06:32
Forum: DOS Batch Forum
Topic: Successfully escape a token delimiter in a fully qualified command path!
Replies: 6
Views: 161

Re: Successfully escape a token delimiter in a fully qualified command path!

I had always understood that you cannot escape token delimiters - only quotes will work. I'm unsure if i misread something here... although i read the batch parsing rules multiple times, i never noticed that and i always thought the excact opposite. No, you did not misread anything. The phase rules...
by dbenham
05 May 2019 06:13
Forum: DOS Batch Forum
Topic: Successfully escape a token delimiter in a fully qualified command path!
Replies: 6
Views: 161

Re: Successfully escape a token delimiter in a fully qualified command path!

Update - The path need not be fully qualified. As long as the volume is specified, you can escape the spaces in the command string - quotes are not needed. C:\test>c:abc^ xyz.bat OK I suppose I shouldn't be too shocked at the inconsistent behavior (quotes not needed with volume, needed without). The...
by dbenham
04 May 2019 22:37
Forum: DOS Batch Forum
Topic: Successfully escape a token delimiter in a fully qualified command path!
Replies: 6
Views: 161

Successfully escape a token delimiter in a fully qualified command path!

I had always understood that you cannot escape token delimiters - only quotes will work. I suppose I knew that the token delimiter is initially escaped in phase 2 , but in a subsequent phase (execution phase 7, possibly others) the token delimiter cannot be escaped. So even if you escape a space in ...
by dbenham
02 May 2019 06:09
Forum: DOS Batch Forum
Topic: LERP() function
Replies: 4
Views: 146

Re: LERP() function

Actually, by escaping the closing parens in the LERP definition, you can gain that last bit of performance and preserve the formatting by combining the last three statements with line continuation. @echo off & setlocal enableDelayedExpansion & mode 100,100 ( for /f %%a in ('echo prompt $E^| cmd') do...
by dbenham
02 May 2019 05:45
Forum: DOS Batch Forum
Topic: LERP() function
Replies: 4
Views: 146

Re: LERP() function

I don't understand what is going on, but I can simplify your code a bit and improve performance :) @echo off & setlocal enableDelayedExpansion & mode 100,100 ( for /f %%a in ('echo prompt $E^| cmd') do set "esc=%%a" ) & echo !esc![?25l set "lerp=?=(a+c*(b-a)*1000)/100000+a" set /a "hei=80, wid=80" s...
by dbenham
26 Apr 2019 04:47
Forum: DOS Batch Forum
Topic: In for loop, how to pass variable from one setlocal to another
Replies: 4
Views: 134

Re: In for loop, how to pass variable from one setlocal to another

As long as you include ENDLOCAL for every SETLOCAL within the FOR loop, then the code will work fine without any recursion limit being reached.

But if you forget the ENDLOCAL, then yes, you can get that error.