I have a .txt (Mac OS X Snow Leopard) file that has a lot of text. At the end of a paragraph, there is a hard return that moves the next paragraph onto another line. This is causing some issues with what I am wanting to do to get the content into my db, so I am wondering if there is anyway I can remove the hard returns? Is there some sort of script I can run? I am really hoping I don’t have to go through and manually take the hard returns out.
To recap, here is what it looks like now:
This is some text. Text is what this is.
And then this is the next paragraph that is on a different line.
And this is what I would like to get to:
This is some text. Text is what this is. And then this is the next paragraph that is on a different line.
For all several thousand lines in my .txt file.
Thanks!
EDIT:
The text I am dealing with in my txt file is actually HTML:
<a href="/link/link/1"> <span class="text">1 </span> THis is where my text is</a><br/>
And when I run the cat command in terminal like mentioned below, only the first is there. Everything else is missing…
I normally just use an editor with good Regular Expression support. TextWrangler is great.
An end of line in TextWrangler is
\r, so to remove it, just search for\rand replace it with a space. TBH, I always wondered how it handles CRLF-encoded files, but somehow it works.