X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4A41A32A37F for ; Wed, 13 Oct 2004 00:59:41 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 70931-01 for ; Tue, 12 Oct 2004 23:59:34 +0000 (GMT) Received: from angel.lonelyplanet.com.au (mail.lonelyplanet.com.au [202.147.44.168]) by svr1.postgresql.org (Postfix) with ESMTP id D8E6032A301 for ; Wed, 13 Oct 2004 00:59:35 +0100 (BST) Received: from shiva.au.lpint.net ([192.168.61.22]) by angel with InterScan Messaging Security Suite; Wed, 13 Oct 2004 09:55:37 +1000 Received: by shiva.au.lpint.net with Internet Mail Service (5.5.2656.59) id <4VK6YDM2>; Wed, 13 Oct 2004 09:56:02 +1000 Message-ID: <82E30406384FFB44AFD1012BAB230B5505F40D46@shiva.au.lpint.net> From: Theo Galanakis To: pgsql-sql@postgresql.org Subject: Re: Export tab delimited from mysql to postgres. Date: Wed, 13 Oct 2004 09:56:01 +1000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C4B0B7.06B7F780" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.0 tagged_above=0.0 required=5.0 tests=DNS_FROM_RFCI_DSN, EXCUSE_16, HTML_20_30, HTML_MESSAGE X-Spam-Level: ** X-Archive-Number: 200410/89 X-Sequence-Number: 19192 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C4B0B7.06B7F780 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thankyou all for your advice, Looking further into the issue I have realised that "data and formatting" lines are denoted by the same CR/LF symbols. So if I where to replace all CR/LF symbols it would create a file with one line... I have replace the CR/LF for reading purposes below with \r\n or alternatively 0D 0A (hex): columnA columnB=0D 1 What a day!\r\n 2 What a week it has\r\n been!\r\n 3 What the!\r\n What this means that it is impossible to move line three back to line two to look something like this: columnA columnB=0D 1 What a day!\r\n 2 What a week it has\rbeen!\r\n 3 What the!\r\n I was thinking of writing code that checked each line to see if correct number of tab delimited elements in this case 2 elements, if this was not the case replace the \r\n with \r. Theo -----Original Message----- From: Harald Fuchs [mailto:hf0722x@protecting.net]=0D Sent: Wednesday, 13 October 2004 1:38 AM To: Theo Galanakis Subject: Re: Export tab delimited from mysql to postgres. > =A0=A0=A0=A0=A0=A0=A0 Could you provide a example of how to do this? Depends on what exactly your dump file contains. Probably something like sed 's/\\\r/\\r/g' This means: replace all carriage returns preceded by a backslash by '\r'. ______________________________________________________________________ This email, including attachments, is intended only for the addressee and may be confidential, privileged and subject to copyright. If you have received this email in error, please advise the sender and delete it. If you are not the intended recipient of this email, you must not use, copy or disclose its content to anyone. You must not copy or=0D communicate to others content that is confidential or subject to=0D copyright, unless you have the consent of the content owner.= ------_=_NextPart_001_01C4B0B7.06B7F780 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: Export tab delimited from mysql to postgres.

Thankyou all for your advice,

Looking further into the issue I have realised that "= ;data and formatting" lines are denoted by the same CR/LF symbols. So = if I where to replace all CR/LF symbols it would create a file with one lin= e... I have replace the CR/LF for reading purposes below with \r\n or alter= natively 0D 0A (hex):

columnA          =        columnB
1         &= nbsp;     What a day!\r\n
2         &= nbsp;     What a week it has\r\n
been!\r\n
3         &= nbsp;     What the!\r\n

What this means that it is impossible to move line three = back to line two to look something like this:

columnA          =        columnB
1         &= nbsp;     What a day!\r\n
2         &= nbsp;     What a week it has\rbeen!\r\n
3         &= nbsp;     What the!\r\n

I was thinking of writing code that checked each line to = see if correct number of tab delimited elements in this case 2 elements, if= this was not the case replace the \r\n with \r.

Theo


-----Original Message-----
From: Harald Fuchs [mailto:hf0722x@protecting.net]
Sent: Wednesday, 13 October 2004 1:38 AM
To: Theo Galanakis
Subject: Re: Export tab delimited from mysql to postgres= .


> =A0=A0=A0=A0=A0=A0=A0 Could you provide a example of= how to do this?

Depends on what exactly your dump file contains.  Pr= obably something like

  sed 's/\\\r/\\r/g'

This means: replace all carriage returns preceded by a ba= ckslash by '\r'.

____________________= __________________________________________________
This email, including= attachments, is intended only for the addressee
and may be confidential= , privileged and subject to copyright. If you
have received this email = in error, please advise the sender and delete
it. If you are not the in= tended recipient of this email, you must not
use, copy or disclose its c= ontent to anyone. You must not copy or
communicate to others content t= hat is confidential or subject to
copyright, unless you have the consen= t of the content owner.
= ------_=_NextPart_001_01C4B0B7.06B7F780--