[postgis-users] Import excel file to postgresql

Pedro Costa pedrocostaarma at sapo.pt
Wed Jun 13 07:55:15 PDT 2012


Try with i sample attached.
be sure that your table must have columns according to the file



Em 13-06-2012 15:50, José María Amuedo escreveu:
> this is my file
>
> 2012/6/13 Pedro Costa <pedrocostaarma at sapo.pt 
> <mailto:pedrocostaarma at sapo.pt>>
>
>     Send me a sample of your file. But you have to remove the last
>     semicolon.
>
>     Your file have to be like that:
>
>
>     column1;column2;column3;333333.3333
>     column1_r2;column2_r2;column3_r2;333333.3333
>
>
>
>
>     Em 13-06-2012 15:34, José María Amuedo escreveu:
>>     I obtened this error:
>>
>>     RROR: extra data after last expected column
>>     SQL state: 22P04
>>     Context: COPY nueva, line 1:
>>     "CODIGO;TIPO;DESCRIPCION;REPRESENTACION;PERFIL;CLAVE;VER3D;CARACBUSQ;LETRA;CAPITULO;SUBCAPITULO;ESTA;..."
>>
>>     2012/6/13 Pedro Costa <pedrocostaarma at sapo.pt
>>     <mailto:pedrocostaarma at sapo.pt>>
>>
>>         Hi José,
>>
>>         You have to convert the excel file to csv and use the copy
>>         command like that:
>>
>>
>>         copy table_name from 'C:\Users\TEMP\filename.csv' WITH CSV
>>         DELIMITER ';';
>>
>>
>>         You have to create the table before and delete the column
>>         names of csv file.
>>
>>
>>
>>
>>         Em 13-06-2012 14:46, José María Amuedo escreveu:
>>>         Hi,
>>>
>>>         I would like to know how can import excel file to
>>>         postgresql. I'm working with linux OS.
>>>
>>>         Thanks
>>>
>>>
>>>         _______________________________________________
>>>         postgis-users mailing list
>>>         postgis-users at postgis.refractions.net  <mailto:postgis-users at postgis.refractions.net>
>>>         http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>>
>>         _______________________________________________
>>         postgis-users mailing list
>>         postgis-users at postgis.refractions.net
>>         <mailto:postgis-users at postgis.refractions.net>
>>         http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
>>
>>
>>
>>     _______________________________________________
>>     postgis-users mailing list
>>     postgis-users at postgis.refractions.net  <mailto:postgis-users at postgis.refractions.net>
>>     http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
>     _______________________________________________
>     postgis-users mailing list
>     postgis-users at postgis.refractions.net
>     <mailto:postgis-users at postgis.refractions.net>
>     http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120613/668603d2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: elements.csv
Type: text/csv
Size: 1464 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20120613/668603d2/attachment.csv>


More information about the postgis-users mailing list