Click to See Complete Forum and Search --> : Copy and paste paragraph into text editor ?


tcurrier
08-30-2008, 08:08 PM
I'm am copying and pasting data from a web site that's in the form of
a paragraph, into a text editor like Notepad, for example, and the result
is that the sentences in the paragraph all run together (on one line) in the
Notepad window.

Web Site:
The rain in spain
falls mainly
on the plain.

Notepad:
The rain in spain falls mainly on the plain.

I want to preserve the original format when pasting into Notepad. Is
there a way to do this?

Thanks for any help.

Coyotelab
08-30-2008, 10:11 PM
<p>The rain in spain</p>
<p>falls mainly</p>
<p>on the plain.</p>

tcurrier
08-31-2008, 08:04 AM
Thanks, but I'm not looking for HTML code. I just want plain
text when I copy into Notepad.

kiwibrit
08-31-2008, 08:09 AM
Or, dare I say:


<p>The rain<br>
in Spain<br>
falls mainly in the plain<p>


I think the line breaks in this case are presentational, not semantic. Therefore, even though <br> is being used for layout, it is acceptable, accessible, and quick to code.

kiwibrit
08-31-2008, 08:12 AM
Thanks, but I'm not looking for HTML code. I just want plain
text when I copy into Notepad.

Looks like you are copying from a site in which the line breaks are forced by the width available in the div, table cell, frame or whatever. In other words, the paste into Notepad is correct, and you will have to introduce the line breaks into Notepad yourself.

JMRKER
08-31-2008, 09:00 AM
While not a total HTML solution, you could create an intermediate application that would allow you to copy from the website and paste into a <textarea>.
Then you could adjust the text area to the desired length using: http://javascript.about.com/library/blspline.htm
Finally, copy from the modified text area into your notepad application.

Would be a two step process, but would save a lot of manual CRLF entries.

tcurrier
08-31-2008, 02:55 PM
JMRKER,

That is exactly what I ended up doing. I have the Visual Basic IDE on my
machine, so I wrote a little VB app that accepts the pasted text, then parses
the text into 'lines' at a character length that I can vary (50, 80, 130, etc.)

I can then copy the parsed text from the VB app into my text editor.

Thanks to all for your help.