Edlin: m (move)

Moves the block of consecutive lines you specify to another location in the file that is in memory.

Syntax

[line1],[line2],line3m

[line1],[+n],line3m

Parameters

line1 : Specifies the first line you want Edlin.exe to move.

line2 : Specifies the last line you want Edlin.exe to move.

line3 : Required. Specifies the line before which you want Edlin.exe to move the block of lines.

+n : Specifies the number of lines that you want Edlin.exe to move, beginning with the line specified in line1 and including the next n lines. If you omit line1, the current line is the starting point for the block of lines that Edlin.exe moves.

Remarks

Windows XP does not use this command. It is accepted only for compatibility with MS-DOS files. 

This tool is not available on Windows XP 64-Bit Edition. 

Renumbering lines

After you move lines, use the l (list) subcommand to see the correctly renumbered lines.

Overlapping line numbers

The line you specify for line3 cannot be part of the block of lines that you want to move. For example, the following command results in an error message:

5,10,8m

If you overlap line numbers in this way, Edlin.exe cannot complete the move operation and displays the following message:

Entry error

Examples

In this example, the following file is in memory and ready to edit. When you use the l (list) subcommand at the * prompt, Edlin.exe displays the contents of the file.

1: Dear Mr. Muth: 
2: 
3: Congratulations on your promotion 
4: to the position of Senior Chemical 
5: Engineer. I continue to be most 
6: impressed with your fine work. 
7: 
8: I think you will enjoy working with 
9: Mr. Lang on the new project. Please 
10: let me know if there is anything I 
11: can do to assist you. 
12: 
13: Sincerely, 
14: 
15: Clay Martin, President 
16: Contoso, Ltd
17: "A World Leader in Technology" 

To move the motto at the beginning of the memo (that is, move lines 16 and 17 before line 1), type:

16,17,1m

At the * prompt, type the l (list) subcommand to see the edited file. Edlin.exe displays the following:

1: Contoso, Ltd
2: "A World Leader in Technology" 
3: Dear Mr. Muth: 
4: 
5: Congratulations on your promotion 
6: to the position of Senior Chemical 
7: Engineer. I continue to be most 
8: impressed with your fine work. 
9: 
10: I think you will enjoy working with 
11: Mr. Lang on the new project. Please 
12: let me know if there is anything I 
13: can do to assist you. 
14: 
15: Sincerely, 
16: 
17: Clay Martin, President 

To move the block of lines, including the current line through the next 25 lines, to immediately before line 100, type:

,+25,100m

Formatting legend

FormatMeaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

Edlin

Edlin subcommands

Command-line reference A-Z



© 2016 Microsoft Corporation. All rights reserved. Contact Us |Terms of Use |Trademarks |Privacy & Cookies