7 messages in com.mysql.lists.win32Re: Loading data into a single from a...| From | Sent On | Attachments |
|---|---|---|
| Pranav Lal | 24 Aug 2005 07:51 | |
| Felix Geerinckx | 24 Aug 2005 08:34 | |
| Daniel da Veiga | 24 Aug 2005 13:01 | |
| Daniel da Veiga | 25 Aug 2005 07:09 | |
| SGr...@unimin.com | 25 Aug 2005 07:12 | |
| Daniel da Veiga | 25 Aug 2005 07:31 | |
| jbon...@sola.com.au | 25 Aug 2005 16:51 |
| Subject: | Re: Loading data into a single from a number of text files![]() |
|---|---|
| From: | Daniel da Veiga (dani...@gmail.com) |
| Date: | 08/25/2005 07:31:54 AM |
| List: | com.mysql.lists.win32 |
There's always a better way to do things. (I'll be using this syntax on my next batch script, I hate myself when I don't read the help) Thanks Shawn.
On 8/25/05, SGr...@unimin.com <SGr...@unimin.com> wrote:
FWIW, the DOS command you would use to create one file by concatenating several files would be the COPY command.
This is from a Win2K command prompt but I can remember using the concatenation form as far back as DOS 2.06 (on a PC Jr.)
C:\>copy /? Copies one or more files to another location.
COPY [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]]
source Specifies the file or files to be copied. /A Indicates an ASCII text file. /B Indicates a binary file. destination Specifies the directory and/or filename for the new file(s). /V Verifies that new files are written correctly. /N Uses short filename, if available, when copying a file with a non-8dot3 name. /Y Suppresses prompting to confirm you want to overwrite an existing destination file. /-Y Causes prompting to confirm you want to overwrite an existing destination file. /Z Copies networked files in restartable mode.
The switch /Y may be preset in the COPYCMD environment variable. This may be overridden with /-Y on the command line. Default is to prompt on overwrites unless COPY command is being executed from within a batch script.
To append files, specify a single file for destination, but multiple files for source (using wildcards or file1+file2+file3 format).
Shawn Green Database Administrator Unimin Corporation - Spruce Pine
Daniel da Veiga <dani...@gmail.com> wrote on 08/25/2005 11:09:41 AM:
On 8/24/05, Pranav Lal <pran...@gmail.com> wrote:
Daniel, <snip That's a good solution, if that doesn't work, you can always build a batch to do that, you can use cat and redirect to concatenate all files within a directory into one, then rename the file as the table name and import it, this way you wouldn't mess with your files (because you would only "cat" them) and could build a daily big file with the content of all the others. PL] I am on Windows XP. I understand that cat is a unix command? I understand that the equivalent command on Windows is type?
Pranav
Geesh, I'm getting banged with all this OSs switching here at the job, yeah, yeah, its "type", didn't realized... Blame me if you use Linux and Win and never did an "ls" at the DOS prompt :)
Sorry,
-- Daniel da Veiga Computer Operator - RS - Brazil -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V- PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++ ------END GEEK CODE BLOCK------
-- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/win32?unsub=sgr...@unimin.com
-- Daniel da Veiga Computer Operator - RS - Brazil -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$ N o+ K- w O M- V- PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+ y++ ------END GEEK CODE BLOCK------




