![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Windows & DOS: Issues & Discussions Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Replace word in a file | sasiharitha | UNIX for Dummies Questions & Answers | 3 | 12-04-2007 09:11 PM |
| replace word in a file | ust | Shell Programming and Scripting | 5 | 11-30-2007 04:03 PM |
| Replace word. | abu_hassan | SUN Solaris | 2 | 03-04-2007 01:14 PM |
| how to replace a word with another | rkrgarlapati | Shell Programming and Scripting | 1 | 07-24-2006 04:42 AM |
| How to replace a word with a series of words in a file | brap45 | Shell Programming and Scripting | 2 | 02-20-2006 10:33 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
how do I replace a word in a file using DOS commands??
how do I replace a word in a file using DOS commands??
|
| Forum Sponsor | ||
|
|
|
|||
|
Just go into the editor (edit.com) and change whatever. I have never seen any version of DOS (except maybe the really old ones) that do not have EDIT.COM among all the normal files like the command interpreter. From what I am aware there isn't an actual command besides edit.com that will do any kind of file editing of that sort in DOS or Windows.
To use EDIT.COM in DOS 1) Go to the directory with EDIT.COM in it (usually in the root of the C: drive or in C:\DOS\ or some similar directory) 2) Type "EDIT $FILEPATH" (excluding the quotation marks of course), where $FILEPATH is the path to the file you wish to edit (example: "EDIT A:\HOMEWORK.TXT" excluding the quotes) 3) In the MS-DOS Editor, navigate to the word you wish to replace, highlight it, and type a new word in. Then, click on File > Save and then File > Exit (or, if you don't have a mouse, use Alt + S then Alt + X) 4) Your file is now edited. Note that this does not work for formatted documents (.rtf, .doc, etc.) and I don't know if this works for documents created with VIM or other UNIX editors; if it's plain text, this method will work. |
|||
| Google UNIX.COM |