Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to import .csv file to a table?

Re: How to import .csv file to a table?

From: Turkbear <john.g_at_dot.spamfree.com>
Date: Thu, 11 Mar 2004 08:47:37 -0600
Message-ID: <jtu050dt5ur982j1odjj9190boi92t0kve@4ax.com>


allan477_at_yahoo.com (Allan Christopher) wrote:

>"gexin" <gexin.chen_at_ncr.com> wrote in message news:<404f01bc_at_rpc1284.daytonoh.ncr.com>...
>> I have experience to import below kinds of text file into a table, but how
>> can I import .csv file in table?
>>
>> Thanks
>
>Since I'm reading this in the Access group I'll give my access answer.
>I have used 3 different methods and am still using the 3rd.
>
>DoCmd.TransferText didn't work for me mainly because of a comment
>field that occasionally had a comma in the comments. It wasn't just
>the comma, there was a date field too that wouldnt load right
>sometimes. Transfer text was too easily confused even when setting
>text qualifiers or using import specs.
>
>For a while I used Chuck Grimsby's clsReadTextFile with good luck.
>This worked because the comment field was surrounded by quotes. I
>would search for commas between the qoutes and replace them with
>pipes. I could then parse the commas and process the line. Then,
>change the pipes back to commmas after the import (Fortunately never
>experienced a single qoute typed in the comment field!).
>
>Now I Dim a New Excel.Application and open the .csv as an
>Excel.Workbook and have been very happy with the results.
>
>Allan Christopher

This shows the problem with cross-posting - I wonder how many database groups the OP sent the original question to? ( He should have fun trying all the variant answers on whatever the actual database is..) Received on Thu Mar 11 2004 - 08:47:37 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US