Remove Text Formatting When Copying-and-Pasting

Have you ever copied some text from a web page or a document and then wanted to paste it as simple text into another application without getting all the formatting from the original source? It can be a problem. Simple copying-and-pasting of formatted text often inserts extra “garbage characters” into the output. In fact, there is a simple solution. Simple, that is, if you know about it.

The problem arises when copying and pasting formatted text from one application to another. It doesn’t always work as you’d expect. For instance, you might copy a few lines from a web page and then want to paste it to Facebook. Surprise! All sorts of “unwanted characters” may appear. The same might happen if you are copying text from a word processing document or from a PDF file and you wish to paste it into an email message.

The unwanted characters typically are formatting commands built into the originating program. The problem is that not all programs use the same formatting commands. For example, what might be a command to “use bold text” in one program could insert curly braces {} into the receiving program.

If you search online, you will find a number of programs that will strip out formatting commands from text. One popular program for Windows users is called PureText and can be found at http://www.stevemiller.net/puretext. While somewhat simple to use, I would suggest that even this program is unnecessary. There is a simpler solution that works well on all operating systems. You probably already have everything you need installed on your computer right now.

All you need is a super dumb ASCII text editor. In this case, the dumber, the better. If your present text editor has commands to use bold, italics, underline, or various fonts, it isn’t dumb enough. A “dumb” ASCII text editor doesn’t know what formatting commands are, so it ignores all formatting and automatically strips out any formatting commands in the text. Once the text has been “sanitized” with the extra characters stripped out, it can safely be copied-and-pasted elsewhere.

Whether or not you realize it, you probably already have a super-dumb ASCII text editor installed in your computer.

Windows

The dumbest ASCII text editor I have ever seen is Windows Notepad. In this case, that’s a good thing. We want it to be unintelligent and unable to add any new commands. There are dozens of ASCII text editors available for Windows, but Notepad is my favorite when stripping out unwanted stuff. Notepad is already installed on every Windows computer.

For the rest of this article, I suggest Windows users should be using Windows Notepad as their “text sanitizer.”

Macintosh

Macintosh systems contain more editing and formatting tools than do Windows systems. In this case, that is a bad thing. Every Macintosh system built in recent years has TextEdit included at no extra cost. TextEdit can be used to strip out formatting, especially if you avoid Styles and other commands. However, it isn’t a true “dumb” text editor as it has some intelligence. You can use TextEdit to strip out formatting, but I suspect you will find it to be a frustrating exercise. There are better tools available.

My favorite Macintosh dumb ASCII text editor is TextWrangler. To be sure, this sophisticated program has a lot of features, but text formatting isn’t one of them! If you switch to TextWrangler, I bet you will never go back to TextEdit.

TextWrangler is a free program that can be downloaded from the Apple App Store or from Bare Bones Software at http://www.barebones.com/products/textwrangler.

For the remainder of this article, everything I write applies equally to Windows NotePad and to TextWrangler on a Macintosh. You can find other simple text editors for Windows or for Macintosh, but the two I mentioned are simple to use, free, and work well for me.

All Operating Systems

First, find the text you wish to copy. Highlight that text, and then use Control-C to copy that text to the operating system’s Clipboard (Mac owners will use Command-C).

Switch to NotePad or to TextWrangler.

Paste your text into the text editor by using Control-V (Mac owners will use Command-V).

Note that the text you want has been pasted into NotePad/TextWrangler without formatting. You have already achieved the goal!

Next, in NotePad or TextWrangler, highlight the text again, and copy it to the Clipboard by using Control-C again (Mac owners will use Command-C).

Now switch to the program where you want to use the final text, and place your cursor into the desired place of insertion. Then press Control-V (Mac owners will use Command-V). Your text, without formatting, is now inserted into the final place you want. You are done.

Simple, eh?

Here are a few other notes:

1. If you wish to copy EVERYTHING on a page, use Control-A (Mac owners will use Command-A) to highlight ALL text, then use Control-C/Command-C.

2. You can also use the pulldown menus in most programs to do the same thing. In the menus, click on EDIT and then on CUT, COPY, SELECT ALL, or PASTE, as needed.

3. However, I would suggest it is easier and much faster to simply memorize the keyboard shortcuts: X to cut, C to copy, V to paste, and A to select “All.”

You don’t need any fancy programs to strip out formatting. You already have everything you need.

“Programs? We don’t need no stinking programs! We’ve got dumb editors!”

21 Comments

Most software has a Paste Special option: Paste > Paste Special > Unformatted text. It requires no special or extra software to work. Simple.

Like

This is great help! Could you address a simple way to cut and paste from a pdf file and convert the text unformatted to a word file? When I paste pdf text to word, I end up with short paragraph that does not fill the space available and I manually fix it. There must be an easier way?

Like

    Mr. Sissman,
    I downloaded PDFX-Change, a free application that enables you to cut and paste text. It’s excellent, works very well.

    Like

    Yes, there is an easier way, although it involves learning to use “regular expressions”.

    Your short paragraphs are caused by a hard line break at the end of each line. You can re-assemble the paragraph by manually deleting the line breaks, but this is very tedious.

    A better way is to get a text editor that recognizes regular expressions (“regex”), such as UltraEdit or Sublime Text. A small investment in learning will pay you back with power and wizardry!

    To strip the line breaks in your example, simply turn on the regular expression feature in your editor, do a search for all “\r\n”, and replace with a blank. This will cause the lines to re-assemble into a paragraph. “\r\n” is regex-speak for “carriage return” (‘\’ is the escape code) and “line feed”, which terminate every line in a text file.

    In regex, ‘^’ is the beginning of a line; ‘$’ is the end of a line. The asterisk ‘*’ means repeat the preceding character.

    So, doing a search for ” *$” and replacing with “” (nothing), will strip all the trailing blanks in all the lines of a file. “^ *” means all the leading blanks.

    There a books written on regex, but you can do useful stuff with just a few notions.

    Like

I usually use Notepad exactly as you described for copying/pasting monthly meeting minutes (prepared in a different software program and received via email) into a Word document. This morning I tested the Paste Special technique that was suggested in the previous comment. Although formatting was removed, each line of the text was treated as a separate paragraph, so there was a line break at the end of each line, as well as a line of space between lines. It’s not difficult to clean up (just insert your cursor at the end of each line and then hit “delete” twice), but it’s certainly much more tedious.

Like

Humphrey, thanks for your recommendation. I use Paste Special all the time with Excel. I’ve been stripping out any invisible code with Notepad for a while now. I do a lot of work in Publisher, often have to cut and paste stuff from web sites, Word docs, Excel, etc. I want to make sure there’s no underlying code so I cut and paste into Notepad, then into Pubby. Never thought to use Paste Special (du-uh). I just tried it and it works like a champ. The only odd thing is that I have to use the Edit > Paste Special menu instead of right clicking to paste. For some reason Paste Special doesn’t appear on the menu when I right click.

This will save me a lot of time, even using the menu.

Like

I would like to find an easy way of removing tabs which these dumb text editors keep in.

Like

Like Humphrey, I have always used Paste Special>Unformatted text. As he says it is really simple. I fear that using additional software is very confusing for those with limited experience and always recommend this Paste Special method to my students.

Like

Thanks for the tip about TextWrangler. I knew about the trick you describe and have used TextEdit but it is always nice to have another program in the event that TextEdit doesn’t produce the desired effect!

Like

In Linux/KDE there is Kate. While not particularly a “dumb editor” it does strip out garbage.

It is also usefull for striping out all the extra, unwanted, HTML from documents created by programs like Word when saving as a web page. But, you have to be able to read and understand HTML.

Like

Some Macintosh programmes also have “Paste as Plain Text” or something similar that strips out all the formatting during the paste operation from the clipboard to where you’re pasting it – e.g. in Reunion for Macintosh it is Command-Option-v, in other applications it can be Command-Shift-Option-v

Roger

Like

Instead of the control commands, I right click and hit copy and then paste. Should it work the same as using the control commands?

Like

    They are the same. A third method is to use the pull-down menus. Click on EDIT along the top of the window, then select COPY or SELECT ALL or PASTE. All three methods provide the same results.

    Like

There is an easier way requiring no special items. Most but not absolutely all text programs, in coding, attach the formatting data to the end, e.g. what you and I observe as the paragraph symbol. If you don’t want to take the formatting with you to the paste destination, simply make sure that you copy only the text but not the paragraph symbol. Again, for most but not absolutely all text programs, the pasted text will adopt the formatting already set for the paragraph it is being pasted into. (I am not a programmer; I just learned this many years ago by the trial and error method.)

Like

When using an iPad, mor or less the same thing can be done using the “Notes” app, by copying the desired text into a new note and then recopying it into the body of your email (or whatever), except the “Notes” app will automatically turn any URLs you may copy into hyperlinks.

Like

Real programmers don’t use word processors – they use line editors.

Like

To get rid of line breaks, I use a method that is a bit easier than deleting each one. I add a character such as “>” to the end of each paragraph, then use “edit” and do a search and replace on the paragraph mark. If I need to add a space, I use that in the replace box. Then I search on my “>” and replace it with a new paragraph mark.

Some of the methods above sound interesting and I will be trying them too.

Like

Try CTRL + ALT + V to paste unformatted text. Works in all Microsoft apps, at least.

Like

    I recently discovered Word and Publisher leave underlying “stuff” in their wake. I now wash everything by cutting and pasting it into Notepad before I paste it into my final document, but I’ll try this CTRL/ALT/V.

    Like

Leave a Reply

Name and email address are required. Your email address will not be published.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

You may use these HTML tags and attributes:

<a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <pre> <q cite=""> <strike> <strong> 

Follow

Get every new post delivered to your Inbox.

Join 7,212 other followers

%d bloggers like this: