Re: Export tab delimited from mysql to postgres. - Mailing list pgsql-sql

From Theo Galanakis
Subject Re: Export tab delimited from mysql to postgres.
Date
Msg-id 82E30406384FFB44AFD1012BAB230B5505F40D46@shiva.au.lpint.net
Whole thread Raw
In response to Export tab delimited from mysql to postgres.  (Theo Galanakis <Theo.Galanakis@lonelyplanet.com.au>)
List pgsql-sql
<p><font size="2">Thankyou all for your advice,</font><p><font size="2">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
wouldcreate a file with one line... I have replace the CR/LF for reading purposes below with \r\n or alternatively 0D
0A(hex):</font><p><font size="2">columnA                 columnB </font><br /><font size="2">1               What a
day!\r\n</font><br/><font size="2">2               What a week it has\r\n</font><br /><font
size="2">been!\r\n</font><br/><font size="2">3               What the!\r\n</font><p><font size="2">What this means that
itis impossible to move line three back to line two to look something like this:</font><p><font size="2">columnA
               columnB </font><br /><font size="2">1               What a day!\r\n</font><br /><font
size="2">2              What a week it has\rbeen!\r\n</font><br /><font size="2">3               What
the!\r\n</font><p><fontsize="2">I was thinking of writing code that checked each line to see if correct number of tab
delimitedelements in this case 2 elements, if this was not the case replace the \r\n with \r.</font><p><font
size="2">Theo</font><br/><p><font size="2">-----Original Message-----</font><br /><font size="2">From: Harald Fuchs [<a
href="mailto:hf0722x@protecting.net">mailto:hf0722x@protecting.net</a>]</font><br /><font size="2">Sent: Wednesday, 13
October2004 1:38 AM</font><br /><font size="2">To: Theo Galanakis</font><br /><font size="2">Subject: Re: Export tab
delimitedfrom mysql to postgres.</font><br /><p><font size="2">>         Could you provide a example of how to do
this?</font><p><fontsize="2">Depends on what exactly your dump file contains.  Probably something like</font><p><font
size="2"> sed 's/\\\r/\\r/g'</font><p><font size="2">This means: replace all carriage returns preceded by a backslash
by'\r'.</font><table><tr><td bgcolor="#ffffff"><font
color="#000000">______________________________________________________________________<br/>This email, including
attachments,is intended only for the addressee<br />and may be confidential, privileged and subject to copyright. If
you<br/>have received this email in error, please advise the sender and delete<br />it. If you are not the intended
recipientof this email, you must not<br />use, copy or disclose its content to anyone. You must not copy or <br
/>communicateto others content that is confidential or subject to <br />copyright, unless you have the consent of the
contentowner.<br /></font></td></tr></table> 

pgsql-sql by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Information about the command SQL " create synonym".
Next
From: "Philippe Lang"
Date:
Subject: Plperlu function & backticks return value -> truncated?