Search found 2254 matches

by dbenham
16 Jul 2019 11:36
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 443
Views: 210409

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

I replaced v8.2 with v8.3 - The only change is to the documentation - Binary files with null bytes may be read with either the /M option, or else via ADO.


Dave Benham
by dbenham
16 Jul 2019 10:50
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 443
Views: 210409

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

@onlinestatements Oh my goodness - I just realized there is a simple solution for reading files with null bytes without using the /M option :!: :D It is the Windows Script Host's TextStream.ReadLine method that is unable to read binary data with null bytes. But JREPL already gives you the option to ...
by dbenham
16 Jul 2019 05:24
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 443
Views: 210409

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

onlinestatements wrote:
15 Jul 2019 21:15
Do you think SED or GREP from GNUWIN32 tools might help me with my problem?
Certainly not grep, as it only does searches, not replace.

I believe sed will work, but I wouldn't know how to do it. You should probably look elsewhere for help with sed.


Dave Benham
by dbenham
16 Jul 2019 05:12
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 443
Views: 210409

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

Izya Kurvitch wrote:
15 Jul 2019 16:51
It replaces the text but exits of the script. Thank you very much!
JREPL.BAT is a batch script (that just happens to incorporate JSCRIPT). Like any other batch script, you must use CALL JREPL if you want to execute JREPL within another batch script and return.


Dave Benham
by dbenham
15 Jul 2019 12:31
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 443
Views: 210409

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

OK, I remember this situation now. No, I don't have a solution for you. JScript has an inherent problem reading lines if the data contains null bytes. The only way JScript can reliably read null bytes is to read the entire file into memory as binary data, which is how the JREPL /M option works. I ca...
by dbenham
11 Jul 2019 11:30
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 443
Views: 210409

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

onlinestatements wrote:
11 Jul 2019 11:22
Is it possible yet to tell jrepl to only search line numbers 3 thru 10?
I have the latest 8.2 version
It is all documented within the built in help.

Option /INC 3:10 will restrict the search to lines 3 through 10


Dave Benham
by dbenham
11 Jul 2019 11:02
Forum: DOS Batch Forum
Topic: jTimestamp.bat date/time utility v2.1 - Replacement for getTimestamp.bat
Replies: 20
Views: 11437

Re: jTimestamp.bat date/time utility v2.1 - Replacement for getTimestamp.bat

Is there any way to get the actual week number of the year to be output or set in variable for further reference? as a TV broadcast company we need that week number out the 52 weeks? Everything is fully documented in the built in help: JTIMESTAMP /? or JTIMESTAMP /?? for paged help If you want the ...
by dbenham
29 Jun 2019 13:57
Forum: DOS Batch Forum
Topic: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like
Replies: 29
Views: 14690

Re: HASHSUM.BAT v1.6 - emulate md5sum, shasum, and the like

Not sure if this could be considered a bug report (or if you can do anything about it), but if you have a file with more than 256 characters hashsum.bat throws an ERROR (which is correct), but it be "more" correct / helpful if it would say "why" this error occured More than 256 chars in the file co...
by dbenham
26 Jun 2019 21:33
Forum: DOS Batch Forum
Topic: JREN.BAT v2.8 - Rename files/folders using regular expressions
Replies: 56
Views: 39072

Re: JREN.BAT v2.8 - Rename files/folders using regular expressions

Why do you think you need JREN.BAT for this? You have the exact source and target name for each rename operation, so just use the REN command.

Code: Select all

for /f "delims=, tokens=1,2" %A in (1.csv) do @ren "%~B" "%~A"

Dave Benham
by dbenham
26 Jun 2019 07:49
Forum: DOS Batch Forum
Topic: Copying CMD.exe using batch file?
Replies: 3
Views: 1238

Re: Copying CMD.exe using batch file?

If you know that you want to copy the contents of the window before the window content is generated, then you can use the CLIP command. For example dir | clip But only the output is captured, not the command itself. If you want the commands to be included, then put the commands in a batch file with ...
by dbenham
24 Jun 2019 11:05
Forum: DOS Batch Forum
Topic: Examination of Linefeeds with CALL
Replies: 18
Views: 6164

Re: Examination of Linefeeds with CALL

I just realized I had to make another change to step 2.3 in the phase rules - Both the search and replace terms allow <LF> characters.

I also corrected step 5.2 in delayed expansion to also allow <LF> in search and replace terms. Not sure why this one wasn't caught ages ago.


Dave Benham
by dbenham
21 Jun 2019 16:03
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.4 - regex text processor with support for text highlighting and alternate character sets
Replies: 443
Views: 210409

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

Solution 1 - Use a FOR /F to parse your definitions and write temporary FIND.TXT and REPL.TXT files. Then use JREPL with the /L literal option and /T translate option. @echo off >find.txt 2>repl.txt ( for /f "delims=, tokens=1*" %%A in (definitions.txt) do ( echo(%%A echo(%%B>&2 ) ) call jrepl find...
by dbenham
14 Jun 2019 07:11
Forum: DOS Batch Forum
Topic: Examination of Linefeeds with CALL
Replies: 18
Views: 6164

Re: Examination of Linefeeds with CALL

Below is evidence that Phase 0 preserves the end of line newline, and that phase 1 truly truncates the line at the first appearing newline not within expanding percents. Also, percent expansion error is not fatal after CALL. It is important that the last line of the script does not end with a newlin...
by dbenham
14 Jun 2019 06:45
Forum: DOS Batch Forum
Topic: Strange double syntax error
Replies: 2
Views: 1754

Re: Strange double syntax error

:shock: Very interesting But I do not get the same results on my Windows 10 64 bit machine. :? What version are you using? The only situation that gives different behavior for me is if the fatal syntax error follows immediately after a CALLed :label (GOTO does not work) And even in this case, only t...
by dbenham
13 Jun 2019 18:43
Forum: DOS Batch Forum
Topic: Examination of Linefeeds with CALL
Replies: 18
Views: 6164

Re: Examination of Linefeeds with CALL

No, because the newlines don't exist until after phase 1 is complete. Within Phase 1, only the outer loop looks for <LF> to truncate. After the %\n% gets replaced, the outer loop scanner continues with the next character after the replacement, so the <LF> is never seen by the scanner, and it is safe...