Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Posts
    205

    Unanswered: How to do data import from a flat file ?

    Hi,

    How to load the data from a flat text file having delimiter ',' between columns ?
    Please give a sample query.

    Thanks,
    Sam

  2. #2
    Join Date
    Apr 2003
    Location
    Tunisia
    Posts
    192

    Thumbs up You can do

    The easiest way is to use http://www.dbtools.com.br thats support importing delimited text.

    The other way is to as if you implementin a dump of a table this is structured this way :

    Create Mytable(
    [Tabl defintion]
    )

    then the data

    Copy Mytable([Tabl defintion]) from stdin;
    Row1 row2 row3 row4
    Row1 row2 row3 row4
    Row1 row2 row3 row4
    ...
    \.
    --End of table

    the delimiter id nothing else tabs

    Then you have to inset that into databse :;
    Psql -T TableName < InputFile

    GoodLuck !
    Open up
    Take a look to my Blog http://www.rundom.com/karim2k

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •