Re: parsing comma separated value files (CSVs)

From: mgumbs <mgumbsNOmgSPAM_at_hotmail.com.invalid>
Date: Thu, 06 Jan 2000 01:15:49 -0800
Message-ID: <21d086a8.d1da29ba_at_usw-ex0102-014.remarq.com>


You don't need to convert them into sql*loader format, you just tell sql*loader what format the input file is in (if that makes sense!). Sql*loader has an option to say what the delimeter is and what surrounds each field.

e.g To cater for "The","Cat","Sat", you specify

fields terminated by ','
optionally enclosed by '"'

Most people tend to use the "The","Cat","Sat" method although you don't have to enclose in quotes if you are confident that the fields do not contain and quotes themselves. I tend to delimit with pipes '|' as well.

Mark

In article <3873CEB2.7CC70D87_at_Lucent.com>, Reg <RegBurgess_at_Lucent.com> wrote:
> I have a number of these "comma separated value files" that I
> want/need to load into a database.
> My main questions are;
> 1) Is this a fairly "standard" format ? {and/or is it likely
> to have
> been exported from another database product ?}
> 2) Is there a utility to either load them directly or convert them
> to
> SQL*Loader format ?
> They have this general form;
> Table,table_name
> Fields,field_name_1, field_name_2
> ,value_1,value_2
> ,value_1_2,value_2_2
> where "Table" and "Fields" are keywords, table_name is the
> name of
> an existing table in the current schema,
> the list of fields is terminated by the end-of-line,
> each line of values starts with a comma,
> there appears to be no special end-of-file, just no more lines of
> values
> any help would be greatly appreciated, etc.
> \R

  • Sent from RemarQ http://www.remarq.com The Internet's Discussion Network * The fastest and easiest way to search and participate in Usenet - Free!
Received on Thu Jan 06 2000 - 10:15:49 CET

Original text of this message