DOS utility to display 1st line of all files in directory? (Users)
Thanks Rugxulo!
I'm going to take your batch file (see below) for a spin. Years ago I used to write a lot of batch files and had a heck of a lot of fun doing it. But that was a decade or more ago, so I'm rusty now. But your little batch file will give me something to play with and try to get back up to speed.
I don't have QBasic installed on my computer, so I figure I'll have to try to find it on an old floppy and install it before your file will work; right? (What do I need to do besides copying the QBasic files to a directory and adding the directory to my path?).
I'm only able to work a few minutes a day at my computers, so this may take me a day or two to get set up.
In the meantime, will your batch file look at the first line of all files in a directory, not just the ones with .txt extension? I use an alpha/numeric code for the three character file extensions as a way of tagging files.
Also, could I add a routine to your batch file so that it would sort the first lines into alpha/numeric order?
Will in Seattle
a.k.a. "Clueless"
> Anyways, here's a quick .BAT / .BAS combo I whipped up that should work
> verbatim in MS-DOS 6. (I assume this does what you want, otherwise you
> might have to use
> Sed,
> Awk,
> Edlin, or similar utility from wherever):
>
> > @echo off
> REM Usage: for %a in (*.txt) do call oneline.bat %a
> set B1=%TEMP%.\oneline.bas
> echo OPEN ENVIRON$("MYFILE") FOR INPUT AS #1 >%B1%
> echo INPUT #1, line$ : PRINT line$ >>%B1%
> echo CLOSE >>%B1%
> echo SYSTEM >>%B1%
> :begin
> set MYFILE=%1
> qbasic /run oneline.bas
> for %%z in (MYFILE B1) do set %%z=
>
---
Will in Seattle
a.k.a. "Clueless"
Running MS-DOS 6.21
Complete thread:
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 18.12.2012, 03:07 (Users)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- DOS utility to display 1st line of all files in directory? - Doug, 18.12.2012, 06:46
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 18.12.2012, 15:37
- DOS utility to display 1st line of all files in directory? - myrkraverk, 18.12.2012, 20:09
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 18.12.2012, 20:19
- DOS utility to display 1st line of all files in directory? - Rugxulo, 18.12.2012, 20:38
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 19.12.2012, 17:55
- DOS utility to display 1st line of all files in directory? - Rugxulo, 19.12.2012, 20:44
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 20.12.2012, 18:14
- DOS utility to display 1st line of all files in directory? - Rugxulo, 20.12.2012, 21:10
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 28.12.2012, 17:42
- DOS utility to display 1st line of all files in directory? - Rugxulo, 20.12.2012, 21:10
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 20.12.2012, 18:14
- DOS utility to display 1st line of all files in directory? - Rugxulo, 19.12.2012, 20:44
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 26.12.2012, 16:32
- DOS utility to display 1st line of all files in directory? - Rugxulo, 26.12.2012, 23:05
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 31.12.2012, 17:24
- DOS utility to display 1st line of all files in directory? - Rugxulo, 03.01.2013, 10:55
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 31.12.2012, 17:24
- DOS utility to display 1st line of all files in directory? - Rugxulo, 26.12.2012, 23:05
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 19.12.2012, 17:55
- DOS utility to display 1st line of all files in directory? - j_hoff, 19.12.2012, 09:47
- DOS utility to display 1st line of all files in directory? - Rugxulo, 18.12.2012, 20:38
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 18.12.2012, 15:37
- DOS utility to display 1st line of all files in directory? - ron, 18.12.2012, 22:48
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 19.12.2012, 18:10
- DOS utility to display 1st line of all files in directory? - ron, 19.12.2012, 22:28
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 19.12.2012, 18:10
- DOS utility to display 1st line of all files in directory? - Doug, 21.12.2012, 00:26
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 21.12.2012, 16:40
- DOS utility to display 1st line of all files in directory? - CluelessInSeattl, 21.12.2012, 17:00
- DOS utility to display 1st line of all files in directory? - Doug, 18.12.2012, 06:46
Mix view