Command line file merge ?

GoldWave general discussions and community help
Post Reply
DougA
Posts: 54
Joined: Fri Dec 28, 2007 2:01 pm

Command line file merge ?

Post by DougA »

Is there a way, via the command line, to merge multiple files into one ?
Similar to "File Merger" tool, only command line driven ?
Doug

BillK
Posts: 32
Joined: Thu Apr 01, 2004 5:53 pm
Location: East Coast of Nebraska

Post by BillK »

If you mean "append" then you can achieve this thru the DOS copy command. as in COPY file1+file2+file3+file4 dest.
The first four files will end up (back-to-back) in the dest file - in the order you listed them. If you want to see this using the DOS copy command, then just type COPY /? at the DOS prompt and it will show you an example. 8)

DougA
Posts: 54
Joined: Fri Dec 28, 2007 2:01 pm

Post by DougA »

Thanks BillK, but I tried the dos copy, and while the resulting file size did get larger, when I load the file into goldwave, i only see the first file. So I'm thinking the audio file must have some kind of markers to indicate end of file. Those apparently are removed when goldwave "merges" the audio files.
Doug

BillK
Posts: 32
Joined: Thu Apr 01, 2004 5:53 pm
Location: East Coast of Nebraska

Post by BillK »

OK Doug, that sounds correct. The file will grow, and yes it should look like there is only one "named" file / song in the result. It should take the name from the Tags that were in the FIRST appended file. AND, these are binary files, so you COULD also include a /B somewhere on the command line to indicate this is a binary copy. (DOS may assume ASCII copy if you don't include the /B).

DougA
Posts: 54
Joined: Fri Dec 28, 2007 2:01 pm

Post by DougA »

I did some research on the .wav file format, turns out to be quite simple.
There are basically 3 "chunks", a RIFF chunk, a fmt chunk, and the data chunk. They all have length fields in them, the RIFF contains the total file length, the fmt is fixed, and the DATA contains the data length.
So, there's no way a DOS COPY is going to work, as these fields need to updated, and also the RIFF & fmt chunks of files 2-n need to be removed.

Could be there can be more stuff, but my CD rips are simple voice recordings, cut into 5 min segments. No tags, no nothing.

And since there doesn't look like any way to automate GW to do the merge, I wrote my own. Turns out it was rather easy.
Doug

GoldWave Inc.
Site Admin
Posts: 3989
Joined: Wed Mar 10, 2004 6:43 pm
Location: St. John's, NL
Contact:

Post by GoldWave Inc. »

You can use the "/clipboard:<filename>" command line parameter with the other batch processing parameters to join two files together. You need to create a preset with a Paste command (and maybe marker settings) so that the clipboard file gets pasted into the processed file. Assuming the preset is named "PasteAtEnd", you'd have the command line:

Code: Select all

...GoldWave.exe /process:PasteAtEnd /clipboard:file2.wav file1.wav
The merged file will be "file1.wav". You can change batch processing folder preset setting if you want the file to be created in a different folder so the original is not replaced.

You'd repeat the command for each file to merge multiple files.

Chris

The Great Watbol!
Posts: 34
Joined: Mon Sep 22, 2008 5:07 am
Location: In the back of your mind(s)

adding all files into one.

Post by The Great Watbol! »

Why can't you load all files, add up the total min'sec. of them.
Create a NEW file that length, Copy & Paste them in Back to Back.
Save the file, and yer done.
Wouldn't this work¿?
------------------------------
¿¿¿-:·}~ «-{Watbol}-» ©2000® ☆*★*☆
(•¿•)

Post Reply