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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
bobax
Posts: 2
Joined: 13 Nov 2020 04:10

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

#481 Post by bobax » 14 Nov 2020 14:18

Thanks a lot for feedback, that is much appreciated.
I am pretty new to this so I will give it a try and experiment on it...

Riko

GEORGE300
Posts: 1
Joined: 08 Feb 2021 13:55

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

#482 Post by GEORGE300 » 08 Feb 2021 14:06

Hello there,

For a dailly usage case in which all files in a folder need to be converted from utf-8 to utf-16 is this script suited ?
So, just run manually script when needed.
Thanks a lot

dbenham
Expert
Posts: 2450
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

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

#483 Post by dbenham » 08 Feb 2021 14:44

Converting utf-8 to utf-16 could be done with JREPL, but you would get much better performance with aGerman's CONVERT.exe. Its sole purpose is to convert text files from one encoding to another.

Both utilities process only one file, so you would have to process an entire folder using a FOR loop either way.

aGerman
Expert
Posts: 4140
Joined: 22 Jan 2010 18:01
Location: Germany

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

#484 Post by aGerman » 08 Feb 2021 15:46

JREPL might be a real good choice because it's a script which works with on-board resources.

Code: Select all

for %%i in ("*.txt") do cmd /c jrepl "^" "" /f "%%~i|UTF-8" /o "-|UTF-16"

CONVERTCP has the disadvantage of being a 3rd party executable. However, if performance matters (e.g. due to big files or a lot of text in total) it might be more suitable for you.

Code: Select all

for %%i in ("*.txt") do convertcp "UTF-8" "UTF-16" /b /i "%%~i" /o "%%~i.tmp~" && move /y "%%~i.tmp~" "%%~i"
(Direct overwriting of the original file is not supported on purpose.)


Beware of running those scripts twice on the same files!

Steffen

Snazz
Posts: 1
Joined: 20 May 2021 21:56

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

#485 Post by Snazz » 21 May 2021 00:19

Hi,

I'm new to JREPL and this level of regex, forgive me if this has been covered in the previous 484 posts.

I've got an expression working on regex101 here but it doesn't seem to work with JREPL.

Code: Select all

(hello_worldi[0-9]+e[0-9]+)
It worked when there was only one "[0-9]+" but having a second one after the "e" seems to break it.

Essentially I'm trying to add a setting to a text file, where the settings only exist there if they're different to default.
So I find the setting that is always next to it, which has dynamic numbers before and after the "e" character.

Hazado
Posts: 1
Joined: 21 May 2021 11:11

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

#486 Post by Hazado » 21 May 2021 11:13

https://regex101.com/r/UnSIRS/1

Im attempting to make this regex work. Does work with regex101.

Regex - <AppSet>[\r\s]*?<Applicator>[\r\s]*?<plMatrixChannelApplicator>[\r\s]*?.*Pinky((?!<\/AppSet>))[\s\S]*?<\/AppSet>

Any Help is appreciated. Thank you

Post Reply