Search found 10 matches

by Outbreaker
21 Sep 2023 20:50
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.6 - regex text processor with support for text highlighting and alternate character sets
Replies: 550
Views: 2166468

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

Here is a JREPL.BAT version that auto detect if a file is in UTF-16 by searching for a UTF16 HEX value in a file. UTF-16LE with BOM = "FF FE" (At the begging of a file). UTF-16LE without BOM = "0D 00 0A 00" (Windows HEX Line Break) / "0A 00" (Linux HEX Line Break). The switch /UTFA will activate the...
by Outbreaker
14 Sep 2023 03:43
Forum: DOS Batch Forum
Topic: JREPL.BAT and UTF auto detect?
Replies: 3
Views: 8358

Re: JREPL.BAT and UTF auto detect?

I found a half automated solution for this. By using the FindStr command which can only search in UTF-8 encoding because of it's limitation. If the FindStr command reads an UTF-16 file, it will see spaces between each character and fails to find the text. The Batch script works by searching for a te...
by Outbreaker
09 Sep 2023 12:04
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.6 - regex text processor with support for text highlighting and alternate character sets
Replies: 550
Views: 2166468

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

I like it simple. :)
But could this occurrence code trick not also be move to /JENDLN to make it even simpler?
by Outbreaker
06 Sep 2023 00:49
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.6 - regex text processor with support for text highlighting and alternate character sets
Replies: 550
Views: 2166468

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

Hi, I found a solution for the occurrence problem. I think this can also be done with "/JENDLN" but had no luck in getting this to work. Works: ".\JREPL.bat" "\[AddReg\]" "++occ==2?$txt='[AddReg]\r\nTestLine.':$txt=$0" /M /JQ /JBEG "occ=0" /F "test.txt" /O "test1.txt" Should also work but it doesn't...
by Outbreaker
01 Sep 2023 01:19
Forum: DOS Batch Forum
Topic: Remove leading digits on each line using JREPL?
Replies: 1
Views: 2757

Re: Remove leading digits on each line using JREPL?

That's the RegEx code I would use with JREPL:

Code: Select all

CALL ".\JREPL.bat" " [0-9].*[0-9]$" "" /XSEQ /F "test.txt" /O "test1.txt"
by Outbreaker
29 Aug 2023 19:11
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.6 - regex text processor with support for text highlighting and alternate character sets
Replies: 550
Views: 2166468

Re: How to replace only the second match in a text file?

@Aacini
I'm already using JREPL.BAT to edit over 500 lines of code. That's why it would be helpful too find a JREPL.BAT command too change only the second match in a text file.
by Outbreaker
29 Aug 2023 18:25
Forum: DOS Batch Forum
Topic: JREPL.BAT v8.6 - regex text processor with support for text highlighting and alternate character sets
Replies: 550
Views: 2166468

How to replace only the second match in a text file?

Hi, Is it possible to tell "JREPL.bat" to only replace the second match "[AddReg]" in a text file :?: I have tried all day long to find a solution for this, but failed. :( The command /INC "120:390" doesn't help because the line numbers will change too much depending on the file. CALL ".\JREPL.bat" ...
by Outbreaker
27 Aug 2023 12:44
Forum: DOS Batch Forum
Topic: JREPL.BAT and UTF auto detect?
Replies: 3
Views: 8358

Re: JREPL.BAT and UTF auto detect?

The problem I have is that sometimes the text file is encoded in UTF-8 and sometimes in UTF-16LE depending on the Language a user has downloaded. :| The tool rxrepl.exe has an /auto switch option, but it will corrupt the text files that are not encoded in UTF-8 Unicode (non-Latin) characters. :( Wou...
by Outbreaker
22 Aug 2023 07:49
Forum: DOS Batch Forum
Topic: JREPL.BAT and UTF auto detect?
Replies: 3
Views: 8358

JREPL.BAT and UTF auto detect?

Hi,
Dose the "JREPL.BAT" tool have an option to auto detect if a text file is encoded in UTF-8 or UTF-16 :?: