Hi

What you might want to do is use sed (stream editor) to fix up the text
file to the format needed for the copy command.  Don't worry if it is a
very big file, sed is *VERY* fast, and uses very little resouces as it
only edits 1 or 2 lines at a time. (That is, you can join 2 lines into
one, it really only operates on one line at a time.)

vi will also do what you want if the file is small, but on big files it
will get progressively slower untill it is almost stopped.

If you don't know about regular expressions, or sed/awk/grep and such,
then you might want to get the O'Rielly book "sed & awk", it is very good,
as all their books are.

Hope that helps
Terry

On Fri, 12 Feb 1999, pbeys wrote:

>  Hello ,
> 
> I'm using COPY to read from ascii files :
> copy xxxxxx from 'myfile' using delimiters ' '
> structure of myfile :
> field1 field2 field3 ...... fieldn
> It's OK
> 
> Now, I need to fill one another table with this file : ( couples of
> lines , each couple of lines must fill one line in the table )
> linea-field1 linea-field2 linea-field3 ...... linea-fieldn <- here is a
> "\n"
> lineb-field1 lineb-field2 lineb-field3 ...... lineb-fieldn
> line of type a
> line of type b
> line of type a
> line of type b
> ... etc
> 
> 
> Is it possible with the COPY command ?
> 
> --
> /* [EMAIL PROTECTED] T�l : +33 04 76 82 80 30   */
> /* http://www-lgit.obs.ujf-grenoble.fr                      */
> /* LGIT - BP 53X      38041 Grenoble Cedex 9                */
> /* T�l : +33 04 76 82 80 39; Fax : +33 04 76 82 81 01       */
> 
> 
> 
> 


Have a great day
Terry Mackintosh <[EMAIL PROTECTED]>               http://www.terrym.com
sysadmin/owner                  I'm excited about life! How about YOU!?
Professional Web Hosting and site design to include programming
Proudly powered by R H Linux 4.2, Apache 1.3.x, PHP 3.x, PostgreSQL 6.x
-----------------------------------------------------------------------
Only if you know where you're going can you get there.

Reply via email to