Results 1 to 4 of 4

Thread: Copying and pasting multiple lines from a file into a new emacs file

  1. #1
    Join Date
    Mar 2008
    Beans
    216

    Copying and pasting multiple lines from a file into a new emacs file

    Hi, I've got lots of text files that I need to copy and paste select regions into a new file (using emacs). If I simply open the original files with 'more', and then highlight the text and then drop it into a new file (opened with emacs) I get line breaks in the middle of my lines (the size of my terminal window determines how many linebreaks I have of course). Is there a good way around this, using a similar method as I'm using? Of course I can simply cat files together and then delete what I don't want, but I'm putting new information in the middle of a file and not necessarily building it from the beginning to the end. Any suggestions?

  2. #2
    Join Date
    May 2009
    Location
    Seattle, WA USA
    Beans
    19
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Copying and pasting multiple lines from a file into a new emacs file

    Is there any reason you can't open the files you want to copy from in Emacs as well? Then you just copy and paste within Emacs. Emacs should ignore the "soft" line breaks that the terminal would otherwise insert.

  3. #3
    Join Date
    Mar 2008
    Beans
    216

    Re: Copying and pasting multiple lines from a file into a new emacs file

    Quote Originally Posted by sjuranic View Post
    Is there any reason you can't open the files you want to copy from in Emacs as well? Then you just copy and paste within Emacs. Emacs should ignore the "soft" line breaks that the terminal would otherwise insert.
    Well okay, I did not know that would work. Figured it was just a copy and paste problem. Thanks, I'm good now

  4. #4
    Join Date
    May 2009
    Location
    Seattle, WA USA
    Beans
    19
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Copying and pasting multiple lines from a file into a new emacs file

    Emacs is an extremely powerful tool (it's basically a LISP interpreter with file editing functions built in). I run my terminal inside Emacs itself so I don't have to worry about ever using my mouse unless I'm browsing the web.

    You can use Emacs as a web browser as well, but I personally think that those guys are just a little crazy.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •