[comp.sys.ibm.pc] Unix-like cat for MS-DOS

djb@wjh12.harvard.edu (David J. Birnbaum) (08/09/89)

MS-DOS 'copy' does not like wildcards; I can not concatenate temp1
and temp2 into temp3 by entering "copy temp? temp3" (assuming that
temp1 and temp2 exist and temp3 doesn't.  The UNIX cat command will
do what I want (cat temp? > temp3).  I looked for an MS-DOS implemen-
tation and tried the one in picnix31, but it includes the EOF
character and I am unable to concatenate text files and then look
at them without tripping over the embedded control-Z.  There doesn't
seem to be a switch that would concatenate text files and dump the
extra control-Zs (retaining the one at the end of the last file, of
course).

Could anyone point me toward an MS-DOS version of cat (or anything 
similar) that will allow me to concatenate text files USING WILDCARDS
without running into my embedded control-Z problem.  I have ftp ac-
cess; if it's available at an archive site, please let me know what
the program is called, where it is, and how to get there by ftp.
Please reply by email to:
  djb@wjh12.harvard.edu [Internet]
  djb@wjh12.uucp [UUCP]
  djb@harvunxw.bitnet [Bitnet]

Thanks.

--David

don@trsvax.UUCP (08/10/89)

>MS-DOS 'copy' does not like wildcards; I can not concatenate temp1
>and temp2 into temp3 by entering "copy temp? temp3" (assuming that
>temp1 and temp2 exist and temp3 doesn't.

Actually, this works fine for me.  Command.com complains that the contents
of the file temp3 is lost, but when I look at the file, it is the correct
concatenation of the two temp files.  If such an error bothers you, there
is an easy solution.  Create a temporary directory called tempdir.  Then
execute the DOS commands:

	copy temp? tempdir\temp3
	copy tempdir\temp3 .

This even takes care of the case where temp3 already exists.  BTW, I'm using
DOS 3.3.
---------------------------------------------------------------------
Don Subt			The opinions expressed above are
Tandy Corp.			strictly mine, not my employer's.

817-390-3068			...!texbell!letni!rwsys!trsvax!don

bga@bgalli.eds.com (Billy G. Allie) (08/11/89)

In article <380@wjh12.harvard.edu>, (David J. Birnbaum) writes:
< MS-DOS 'copy' does not like wildcards; I can not concatenate temp1
< and temp2 into temp3 by entering "copy temp? temp3" (assuming that
< temp1 and temp2 exist and temp3 doesn't.  The UNIX cat command will
< do what I want (cat temp? > temp3).  I looked for an MS-DOS implemen-
< tation and tried the one in picnix31, but it includes the EOF
< character and I am unable to concatenate text files and then look
< at them without tripping over the embedded control-Z.

Try the following command:

	c:\>for %i in (temp?) do type %i >>temp3

This should do what you want for text files.
-- 
____	   | Billy G. Allie	| Internet..: bga@bgalli.eds.com
|  /|	   | 7436 Hartwell	| UUCP......: uunet!{mcf|edsews}!bgalli!bga
|-/-|----- | Dearborn, MI 48126	| Compuserve: 76337,2061
|/  |LLIE  | (313) 582-1540	| Genie.....: BGALLIE

w8sdz@smoke.BRL.MIL (Keith Petersen) (08/11/89)

One way to copy several text files into one output file is

COPY NUL+*.TXT MY.OUT

-- 
Keith Petersen
Maintainer of SIMTEL20's CP/M, MSDOS, and MISC archives
Internet: w8sdz@WSMR-SIMTEL20.Army.Mil [26.2.0.74]
Uucp: {ames,decwrl,harvard,rutgers,ucbvax,uunet}!wsmr-simtel20.army.mil!w8sdz

davidr@hplsla.HP.COM (David M. Reed) (08/12/89)

If I recall correctly, you can use the DOS COPY command to combine files:

    COPY file1 + file2 + file3 file4

will combine files 1, 2 and 3 into a new file named file 4.  If you left off
a target file name (file4), then files 2 and 3 would be added to file 1.