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_01C0CC40.2EC639D0
Content-Type: text/plain
1.- edit file
vi file-name
2.- remove ^M from all lines in file ( use ^V and ^M for see it in vi )
:1,$s/^M//g
3.- put ^M
:1,$s/$/^M/g
> -----Mensaje original-----
> Enviado el: Lunes 23 de Abril de 2001 7:26 AM
> Asunto: Re: removing newline charcter in SQL
> You can use the unix tool dos2unix <infile> <outfile>
> Problem solved?
> It's hard to globally replace an EOL character within vi, at least
> until now I never succedded doing that, if you do, I'd like to know how.
> Greetings,
> Frank Wouts
> Informa Automatisering B.V.
> The Netherlands
> > Hi All
> > I'm using informix 7.31 on an AIX 4.3.3 and have a slight problem
> removing
> > newline charcters from SQL
> > Assume we have a tuple consisting of one string field:
> > "frist line^Msecond_line^Mthird_line^M"
> > Does anyone know how to remove newline charcters from such a string
> > (newline character could be created either from UNIX or Windows).
> > I think that i should probably use the replace function, but i can't get
> it
> > to match
> > any of the following:
> > %n
> > \n
> > ^M
> > ascii(13)
> > I would prefere a solution that doesn't use PL/SQL or stored procedures.
> > Best Regards Thomas
------_=_NextPart_001_01C0CC40.2EC639D0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: removing newline charcter in SQL</TITLE>
</HEAD>
<BODY>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">1.- edit file</FONT>
</P>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">vi file-name</FONT>
</P>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">2.- remove ^M from =
all lines in file ( use ^V and ^M for see it in vi )</FONT>
<BR><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">:1,$s/^M//g </FONT>
</P>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">3.- put ^M</FONT>
</P>
<P><FONT COLOR=3D"#0000FF" SIZE=3D2 FACE=3D"Arial">:1,$s/$/^M/g</FONT>
</P>
<BR>
<UL>
<P><FONT SIZE=3D1 FACE=3D"Arial">-----Mensaje original-----</FONT>
<BR><B><FONT SIZE=3D1 =
FACE=3D"Arial">De: </FONT></B> <FONT SIZE=3D1 =
<BR><B><FONT SIZE=3D1 FACE=3D"Arial">Enviado =
el: </FONT></B> <FONT SIZE=3D1 =
FACE=3D"Arial">Lunes 23 de Abril de 2001 7:26 AM</FONT>
<BR><B><FONT SIZE=3D1 FACE=3D"Arial">Para: </FONT></B> <FONT =
<BR><B><FONT SIZE=3D1 FACE=3D"Arial">Asunto:</FONT></B> <FONT SIZE=3D1 =
FACE=3D"Arial">Re: removing newline charcter in SQL</FONT>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">You can use the unix tool dos2unix =
<infile> <outfile></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Problem solved?</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">It's hard to globally replace an EOL =
character within vi, at least</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">until now I never succedded doing =
that, if you do, I'd like to know how.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Greetings,</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Frank Wouts</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">Informa Automatisering B.V.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">The Netherlands</FONT>
</P>
</P>
<P><FONT SIZE=3D2 FACE=3D"Arial">> Hi All</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> I'm using informix 7.31 on an =
AIX 4.3.3 and have a slight problem removing</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> newline charcters from =
SQL</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> Assume we have a tuple =
consisting of one string field:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> "frist =
line^Msecond_line^Mthird_line^M"</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> Does anyone know how to remove =
newline charcters from such a string</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> (newline character could be =
created either from UNIX or Windows).</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> I think that i should probably =
use the replace function, but i can't get it</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> to match</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> any of the following:</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> %n</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> \n</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> ^M</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> ascii(13)</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> I would prefere a solution that =
doesn't use PL/SQL or stored procedures.</FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">></FONT>
<BR><FONT SIZE=3D2 FACE=3D"Arial">> Best Regards Thomas</FONT>
</P>
</UL>
</BODY>
</HTML>
------_=_NextPart_001_01C0CC40.2EC639D0--