TextEdit - Can line-break code be used in find/replace

Discussion in 'Mac Apps and Mac App Store' started by MacLustre, Feb 3, 2010.

  1. MacLustre macrumors newbie

    Joined:
    Feb 3, 2010
    #1
    Hi
    I want to convert text that I've copy-pasted from email.
    Email text is narrowed, and I want the text to fully flow and word-wrap across a page.
    I only know a method I used in NoteTabLight.
    There, I could find/replace ^p with a space: Replace the line break (then remove any double spaces later).
    Neither ^p nor ^P work in TextEdit or Bean.
    What is the method people use on this OS, to remove line breaks in this type of situation?
    (And, because I'm very poor at guessing keywords and method terms, please be sure to include, "It's called [term]".)

    Thanks
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Get TextWrangler (free), it allows for regular expressions (grep) for the find and replace, which can be used to match new lines. New lines are noted by \r for the search. Though, more simply, it also has an option to unwrap selected text (Text > Remove Line Breaks). Multiple spaces can be removed using a grep find/replace by searching for [\s]+ and replace with a single space. If you have quoted emails that have lines starting with > there's an option to add or remove these under the Text menu.
     
  3. MacLustre thread starter macrumors newbie

    Joined:
    Feb 3, 2010
    #3
    Thanks, angelwatt.

    TextWrangler has interesting features.
    I think i need to learn how to widen text margins, because after I removed the hard lines, and saw that I needed to call a word-wrap to keep the text inside the window, the soft word-wrap returned the text to the narrow margin.
    I'll figure it.

    Thanks
     
  4. mysterytramp macrumors 65816

    mysterytramp

    Joined:
    Jul 17, 2008
    Location:
    Maryland
    #4
    Just like angelwatt said, Text Wrangler is great. But if you find yourself just wanting to search for carriage returns in a text file, you can select one, copy it, then paste it in the "Find" dialog of either TextEdit or Bean.

    And, you could create the string you're searching for in your document window, copy and paste it into the Find dialog. Then go back to the document window to create the replacement string, copy and paste it into the Find dialog and then you're in business.

    mt
     
  5. MacLustre thread starter macrumors newbie

    Joined:
    Feb 3, 2010
    #5
    "if you find yourself just wanting to search for carriage returns in a text file, you can select one, copy it, then paste it in the "Find" dialog of either TextEdit or Bean."
    -----------
    I'm glad I went back and tried that again. This time it worked.

    I'm using a split-key keyboard on my Mac, and it's led to confusion a few times. Maybe it's the reason I didn't block-and-copy the line break correctly the first time.

    Thanks, everyone, for the help. This solved my problem and got me introduced to TextWrangler.

    Cheers
     

Share This Page