Solved

Copy lines from one file to another with mc

Posted on 2011-02-18
3
601 Views
Last Modified: 2012-05-11
Hi,
How can i use midnight commander to copy some lines from one file to another ?

Thanks!
0
Comment
Question by:Cristi_E
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Expert Comment

by:mccracky
ID: 34927235
Why with mc?  Use bash.

Grab someline from somefile and append it to otherfile:

grep  someline somefile >> otherfile
0
 
LVL 35

Accepted Solution

by:
torimar earned 500 total points
ID: 34946235
If you wish to use MC, here's a way that should comply with most setups:

- in MC, press F9 for the menu, then select 'Options > Configuration' and make sure "Internal Editor" is selected
- Open the file you wish to copy from with F4
- Take the cursor to the beginning of the block you wish to copy, then press F3 for mark-up mode, then mark the block (or simply use the mouse for marking)
- Press CTRL + F, confirm to copy to the default temporary file "cooledit.clip"
- Close the source file
- Open the target file with F4
- Move the cursor to the paste location
- Press SHIFT + F5
- Confirm to paste from the default temp file "cooledit.clip"

Instead of using shortcuts, you could also just press F9 inside the editor to enter its pulldown menu, then use the File menu to copy/paste to file.
0
 
LVL 4

Author Comment

by:Cristi_E
ID: 34949569
Hi torimar,
It worked just great!

I thought this is a routine task in linux. I'm surprised to see that the answer has come with difficulty!

Thanks !
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

687 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question