Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

DOS utility to display 1st line of all files in directory? (Users)

posted by j_hoff, 19.12.2012, 09:47

> I'd love to give it a try. But I have one big concern, and that is whether
> or not installing it would interfere with the execution of commands in my
> existing version of MS-DOS 6.21.
>
> I depend on a large number of batch files, some of them rather complicated,
> for executing series of my most frequently used commands. I use a text
> editor with a built in macro language that allows me to call DOS commands
> and batch files from keyboard shortcuts from within the editor.

One (of many others) way to get the job done, which does not require you to change to another DOS version or an alternative shell, could be like this:

1. write a short batch file and name it 'HEAD.BAT':
@ECHO OFF
FAM /L-2 < %1

2. execute the following (example) command:
FOR %f IN (*.txt) DO CALL HEAD %f

You can find the program FAM as part of the package DOSUTILS.ZIP which, in-turn you will find here: http://www.bttr-software.de/products/jhoffmann/

Of course using the program FAM for the purpose of just displaying the first line of a file is kind of overkill, as this program can do much more, but if you make intensive use of batch programming you might be interested in the various utilities of the DOSUTILS package anyway. So just give it a try.

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum