Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combine multiple files into one
Message
 
 
To
27/06/2008 03:30:10
General information
Forum:
Windows
Category:
Computing in general
Miscellaneous
Thread ID:
01327110
Message ID:
01327226
Views:
13
>>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
>
Didn't work yesterday correctly for me.

I tried COPY Create_*.sql LongSQL.SQL and only the first file was copied correctly, the rest was garbage. I also was unable to switch to USB drive from DOS cd command.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform