# Batch file to find and replace while keeping formatting? [closed]

Is there any way to make a batch file that will find and replace while keeping formatting like replcaing

\begin{center}
\begin{tikzpicture}[declare Function ={fy(\x)=sin(\x+rand*100)^2;}]
\begin{axis} [
Xmin=-720, xmax=720,
Width=10cm, height=10cm,
Tick style=black,
Clip mode=individual,
X axis line style={opacity=0},
Y axis line style={opacity=0},
Ticks=none
]

Ultra thick,
Smooth,
Tension=1,
Samples=30,
Domain=-720:720
] {fy(x)};

\draw[latex-Latex, xshift=-0.5cm] ({rel axis cs:0,0}|-{rel axis cs:0,0})--({rel    axis cs:0,0}|-{rel axis cs:0,1}) node[left, pos=0.5] {$h$};
\end{axis}

\end{tikzpicture}
\end{center}

with this

\begin{tikzpicture}[declare function ={fy(\x)=sin(\x+rand*100)^2;}]
\begin{axis} [
xmin=-720, xmax=720,
width=10cm, height=10cm,
tick style=black,
clip mode=individual,
x axis line style={opacity=0},
y axis line style={opacity=0},
ticks=none
]

ultra thick,
smooth,
tension=1,
samples=30,
domain=-720:720
] {fy(x)};

\draw[latex-latex, xshift=-0.5cm] ({rel axis cs:0,0}|-{rel axis cs:0,0}) -- ({rel    axis cs:0,0}|-{rel axis cs:0,1}) node[left, pos=0.5] {$h$};
\end{axis}

\end{tikzpicture}

I searched the internet for one good hour and i found that even wordpad cannot do this.

Can a batch file achieve this.

Any help is appreciated

Can any other program do this using command line ?

• This doesn't seem like a find and replace example. The only difference I see is a line removed from the beginning of the file and a line removed from the end of the file. – Squashman Dec 16 '17 at 17:27
• @Squashman it seems that everything else in between got lowercased – janos Dec 16 '17 at 17:34

I can only assume what changes you are attempting to make, and by what rules, because you were too lazy to describe the logic of what you are trying to achieve.

It looks to me as though you want to remove the 1st and last line of the input, and change the case of the remaining text to all lower case.

This is trivial with JREPL.BAT - a regular expression text processing utility. JREPL is pure script (hybrid JScript/batch) that runs natively on any Windows machine from XP onward - no 3rd party exe file required.

jrepl "^.*" "$txt=$0.toLowerCase()" /jmatchq /exc "1,-1" /f "yourFile.txt" /o -

If you put the command within a batch script, then you must use call jrepl so that your script continues to run after JREPL is finished.