1.

Solve : Did you ever use EdLin??

Answer»

Did you ever use EdLin? Or anything like it?
Does anybody here know what I mean? It was a line editor. You would edit lines of test one line at a time. You could read a number of lines in. Make a replacement. Insert a line. Then read the rest of the files and then write to whole thing out to a new file. I think you could give it commands in batch file. I don't remember. Is there SOMETHING like that that can run from a batch files?
edlin still exists, may be possible to write a script for it
try edlin edlin test FNF...(File Not Found) edlin was supposed to DIE when they replaced it in DOS 6 with EDIT. (well, edit was actually in DOS 5 as well, I believe, but I guess they kept edlin for those poor folks that couldn't deal with more then one line of text at once.)Edlin is the only thing I know of in DOS that can take a command line arguments beyond just the file name. If you say
edlin test
It will open the file "test" if it exists, or created it. You can not put that part in a script.
I took the recommendation of an earlier post and made a scipt file. But I can not call it anything but a .TXT file or I can not edit it in notepad.
So far I now got this:
edlin test.txt Which will WORK nice if there is a short file called 'TEST.TXT' and a file called 'FILE.TXT" that has just this:
?
l
q
y

Yeah, That all Shows the help. list the file, quits and says yes.
Now If I can get it to do something useful!Quote from: Geek-9pm on January 07, 2009, 10:02:43 AM

Edlin is the only thing I know of in DOS that can take a command line arguments beyond just the file name.

err... I must be confused as to what you mean, since Dir can take a filename and switches, and almost any other command, sich as Find or fc, takes arguments other then filenames.



one use of an edlin script would be to skip lines, or process text in a line based fashion. (make a file with every second line, or third line, for example)Quote
err... I must be confused as to what you mean, since Dir can take a filename and ...

Story. I meant as a text replacement editor. ATTRIB, COPY, DIR, FC, and so on I would not use to edit a text file. But what do I know? May be one can edit a file with the FOR command.

Sometimes I want to do a massive replacement of a few strings in a array of HTML files I work with. It would be nice if edlin could just take parameters from the command line and do a whole bunch of files in nested batch files. Not having much success with it, I wrote a small file in QBASIC that does the job in an seasick kind of way. If edlin is a neat and versatile alternative, I might prefer that.

I would try the FOR command, that really makes me seasick.

edit takes a filename, THOUGH. so does notepad.Hello BC.
Sorry, I did not make myself clear. I did not mean to say other things can not be started from the command line.
Rather I want to have a batch file the can process a large number of text files.
Somewhere else I found a reverence to Edlin as the thing you would use in a batch file. The batch file will give STUFF to the text editor.
For Edlin the general form is:
Edlin source-file Where source-tile is a text file to be read.
Where command-list is a file of commands and things.

ahh, so what you mean, is that while edit and so forth take filenames and can open them, you can't actually say, modify the file through batch, and that's what your looking to do with edlin?

That makes sense, I think I gotcha now Quote
modify the file through batch, and that's what your looking to do with Edlin?
Yeah. You got what I mean.
Don't pay attention to what I say, just what I mean.

Most of the pre-GUI programs all took input from the thing called STDIN. When you start a CMD or otherwise get into DOS, all input goes via STDIN and the batch program has the authority to filter the stream. So things like %1 %2 %3 and so on are expanded into values that suit the moment. This allows the use of loops or serial re-entry or whatever it is they call that. That way you could have a 100 slightly different HTML files and each could get the same or different STRING replacements. The replacements would be in a list of pairs. I guess you can do that in Word. but I don't know how and I am a slow learner. But I have yet to master it in Edlin. I think what is going to stick me is the CTRL-Z thing that Edlin wants. I think in Windows 2000 there is an option to fix that.


Discussion

No Comment Found