JREPL.BAT (The successor to REPL.BAT) is now available at: viewtopic.php?f=3&t=6044
Dave Benham
regex search and replace for batch - Easily edit files!
Moderator: DosItHelp
-
- Posts: 1
- Joined: 10 Feb 2015 05:22
Re: regex search and replace for batch - Easily edit files!
Hi!
I try to replace erase a multiline-string from a XML-file:
<subsystem xmlns="urn:jboss:domain:jmx:1.1">
<show-model value="true"/>
<remoting-connector/>
</subsystem>
With this Command:
type "C:\Users\%USERNAME%\Desktop\standalone-mach_174.xml"|repl /M "(<subsystem xmlns=.*urn:jboss:domain:jmx:1.1.*>[\r\n]<show-model value=.*true.*/>[\r\n]<remoting-connector/>[\r\n]</subsystem>)" "" >standalone-mach_174.xml.new
move /y "standalone-mach_174.xml.new" "standalone-mach_174.xml" >nul
Can you help me?
I try to replace erase a multiline-string from a XML-file:
<subsystem xmlns="urn:jboss:domain:jmx:1.1">
<show-model value="true"/>
<remoting-connector/>
</subsystem>
With this Command:
type "C:\Users\%USERNAME%\Desktop\standalone-mach_174.xml"|repl /M "(<subsystem xmlns=.*urn:jboss:domain:jmx:1.1.*>[\r\n]<show-model value=.*true.*/>[\r\n]<remoting-connector/>[\r\n]</subsystem>)" "" >standalone-mach_174.xml.new
move /y "standalone-mach_174.xml.new" "standalone-mach_174.xml" >nul
Can you help me?
-
- Posts: 1
- Joined: 23 May 2016 11:29
Re: regex search and replace for batch - Easily edit files!
I am using Geany editor for various programming languages like PHP, Javascript etc.
Now I want to replace/remove certain text inside a Text block (selection of text) and not entire file.
I know Geany can pass currently selected text block to external commands through Context Menu > Format > Send selection to > Command.
How can I receive the currently selected text through stdin/stdout scenario and replace the text and send updated text block back to the file through stdout in Repl ?
Now I want to replace/remove certain text inside a Text block (selection of text) and not entire file.
I know Geany can pass currently selected text block to external commands through Context Menu > Format > Send selection to > Command.
How can I receive the currently selected text through stdin/stdout scenario and replace the text and send updated text block back to the file through stdout in Repl ?
Re: regex search and replace for batch - Easily edit files!
jrepl and repl can accept stdin and output to std out.
How does geany package the data?
How does geany package the data?