On 1/23/07, Dennis Bagley <[EMAIL PROTECTED]> wrote:
Hey folks, I have an ascii database containing approximately 190,000 records.
I assume you mean a CSV or other character delimited flatfile? I need to import the data into a dbms, trim out fields I do not need and
extract about 10,000 records.
Any particular DBMS you have interest in? PostgreSQL has the COPY command, MySQL has the LOAD DATA command. For example, if I wanted to import the following CSV into PG: 1,josh,"Some programmer" 2,jon,"Another programmer" I would do a : # Create the table for storage: CREATE TABLE some_table (id integer NOT NULL PRIMARY KEY, name varchar(20), desc text); # import the CSV file COPY some_table FROM '/path/to/some_csv.txt' DELIMITERS ',' CSV You can include specific columns you wish to fill. If you wish to remove columns from the CSV, you can easily use `cut` to do so.
_______________________________________________ RLUG mailing list RLUG@rlug.org http://lists.rlug.org/mailman/listinfo/rlug