-3

I have a huge .txt file in which i want to find the regular expression (^.+$)\n and replace it with \1\n. Currently i'm doing it manually.

how can i automate this using batch script?

user2919579
  • 39
  • 2
  • 10
  • sed is your friend for doing batch editing: [man page for sed](https://linux.die.net/man/1/sed) – StvnBrkdll Mar 31 '17 at 13:05
  • 2
    there is no `batch` command for that. But dbenham has written a hybrid batch file to do that (if you can't /don't want to install some unix tools). Search for [jrepl](http://stackoverflow.com/search?q=jrepl) to find a lot of answers using this tool. – Stephan Mar 31 '17 at 13:07

1 Answers1

1

If I understand your expression properly:

^  - Start of Line.
.+ - Any character, possibly repeated
$  - End of Line
\n - Followed by a blank line

And you want to replace it with:

Everything you Captured
\n

That looks like it does not accomplish anything.
Doesn't that just replace each line with the same line?

Can you clarify your intent?

abelenky
  • 63,815
  • 23
  • 109
  • 159
  • I just want to add \r\n at the end of every line. – user2919579 Apr 01 '17 at 03:47
  • Why didn't you say so? That is a ***very*** different question. I think what you want is: http://stackoverflow.com/questions/17579553/windows-command-to-convert-unix-line-endings – abelenky Apr 01 '17 at 03:59