• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 605
  • Last Modified:

Copy lines from one file to another with mc

Hi,
How can i use midnight commander to copy some lines from one file to another ?

Thanks!
0
Cristi_E
Asked:
Cristi_E
1 Solution
 
mccrackyCommented:
Why with mc?  Use bash.

Grab someline from somefile and append it to otherfile:

grep  someline somefile >> otherfile
0
 
torimarCommented:
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
 
Cristi_EAuthor Commented:
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

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now