Regex pattern for data cleaning with windows batch file and
<p>I have a file which is, sometimes, not properly formatted because of CR/LF.</p>

<p>A good file looks like this:</p>

<blockquote>
<pre><code>R00023j Field1 Field2 .... CR/LF
R00024n Field1 Field2 .... CR/LF
R00025k Field1 Field2 .... CR/LF
</code></pre>
</blockquote>

<p>But sometime I have a CR/LF inserted in one the fields and It produce a file like this:</p>

<blockquote>
<pre><code>R00023j Fiel CR/LF
d1 Field2 .... CR/LF
R00024n Field1 Field2 .... CR/LF
R00025k Field1 Field2 .... CR/LF
</code></pre>
</blockquote>

<p>We can consider that we have "goods" CR/LF (at the end of the line) and "bad" CR/LF (into a field).</p>

<p>We can consider that a good CR/LF is the one with <code>RxxxxxY</code> immediatly after it, on the next line.
All other CR/LF are bads and have to be replace by a <code>.</code> (dot).</p>

<p><code>x</code>: digit<br>
<code>Y</code>: letter</p>

<p>How is is possible to achieve a file data cleansing with a Windows batch file and RegEx?</p>