Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combine multiple files into one
Message
From
27/06/2008 03:30:10
 
General information
Forum:
Windows
Category:
Computing in general
Miscellaneous
Thread ID:
01327110
Message ID:
01327169
Views:
11
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>Is it possible with some Windows commands to combine multiple files (.sql) into one big .sql file? Preferably with adding GO in between?
>
>UPDATE.
>
>Nobody helps me, so I had to help myself.
>
>http://www.lagmonster.org/docs/DOS7/z-copy.html
>
>UPDATE2. DOS doesn't seem to recognize USB device, so I would have to copy the folder to the c drive.
>
>UPDATE3. Using DOS command resulted in garbage, so I manually combined the files (~6) using Edit and copy and paste technique. I already updated test server, now I have to update production.

"DOS" (actually CMD) window with COPY command using concatenation works fine for me (note that in the following examples, none of the REM comments should be included in the actual test files). It should also work fine with USB drives, as long as their file systems are properly mounted i.e. have been assigned drive letters:
REM Test SQL file TestSQL.sql
blah
blah
woof
woof
REM Go.txt
REM Intermediate insertion of the word "go":
REM Note the leading and trailing CRLFs in case a preceding or following file doesn't have them
REM Extra CRLFs in scripts are usually ignored

go
Now you can concatenate the files:
COPY TestSQL.sql+Go.txt Output.sql
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform