jQuery in Action, 2nd edition*
The moose likes Beginning Java and the fly likes Copy code to TextPad - no linefeeds?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Copy code to TextPad - no linefeeds??" Watch "Copy code to TextPad - no linefeeds??" New topic
Author

Copy code to TextPad - no linefeeds??

Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
Hi Ranchers,
Here is my beginner's question - how do I copy and paste code segments into my textpad editor so as to retain the formatting?
I see from viewing the source code that each line finishes with a " < b r />" markup (spaces inserted to stop it from affecting this post). These "br"'s do not translate to linefeeds in my copy and paste. There must be a simple answer to this?


The nice thing about Standards is that there are so many to choose from!
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Copy it into Word, then copy it from Word.
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
Thanks Michael, fantastic - btw I also tried wordpad, but that ignored the tabs.
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Alternatively, for copying code examples from these forums, you can click the "reply with quote" link, then copy the code from the text area that appears (and then actually reply or don't reply as you see fit).


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
You can also use TextPad's search and replace tool. As long as you turn on the regular expression feature, it will recognize \n as a newline character.


Java API Documentation
The Java Tutorial
Eddie Vanda
Ranch Hand

Joined: Mar 18, 2003
Posts: 281
Thanks guys,
That's given me a few more ways to try out. Unfortunately the " < b r />" markup tag that I see when I view source on the browser does not seem to carry across on cut and paste, neither to textpad nor to dos edit. At least when I save files from there they don't show up on debug. But now I am happily cutting and pasting through word and getting beautiful looking code. Now if only I could find where word stores the default spacing for tab ............
Ed
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Copy code to TextPad - no linefeeds??