Detect "Enter" keycode in data

Detect "Enter" keycode in data

Post by krist » Sun, 16 Nov 2003 09:46:50



Hi

I've a VARCHAR column that corresponds with multi-line textbox. The problem
is that I need to extract the data into a textfile as a single line text but
there are "Enter" key in the data causing the extracted line to be
multi-line too. Is there any method to detect those "Enter" key in the data?

Thx

 
 
 

Detect "Enter" keycode in data

Post by Gert-Jan Stri » Sun, 16 Nov 2003 13:16:18


Yes, you can use the CHAR() or NCHAR() function for that (depending on
whether you are using varchar or nvarchar). A carriage return is code
13, a line feed 10. On a windows system you will get a CR plus a LF, so
CHAR(13)+CHAR(10). Use this with CHARINDEX or PATINDEX

Hope this helps,
Gert-Jan


> Hi

> I've a VARCHAR column that corresponds with multi-line textbox. The problem
> is that I need to extract the data into a textfile as a single line text but
> there are "Enter" key in the data causing the extracted line to be
> multi-line too. Is there any method to detect those "Enter" key in the data?

> Thx


 
 
 

Detect "Enter" keycode in data

Post by Uri Diman » Mon, 17 Nov 2003 14:15:36


kriste
In addition to Gert's responce I have experienced with some situation that
after perfoming  CHAR(13) +CHAR(10) it was still appear 'ENTER'
Here  I think I prevent all(after that I did not encounter with the problem)
 situations to have a 'ENTER'



BEGIN

END


> Yes, you can use the CHAR() or NCHAR() function for that (depending on
> whether you are using varchar or nvarchar). A carriage return is code
> 13, a line feed 10. On a windows system you will get a CR plus a LF, so
> CHAR(13)+CHAR(10). Use this with CHARINDEX or PATINDEX

> Hope this helps,
> Gert-Jan


> > Hi

> > I've a VARCHAR column that corresponds with multi-line textbox. The
problem
> > is that I need to extract the data into a textfile as a single line text
but
> > there are "Enter" key in the data causing the extracted line to be
> > multi-line too. Is there any method to detect those "Enter" key in the
data?

> > Thx

 
 
 

Detect "Enter" keycode in data

Post by Roji. P. Thoma » Tue, 18 Nov 2003 08:33:24


The text 'ENTER' appears in Data?????


> kriste
> In addition to Gert's responce I have experienced with some situation that
> after perfoming  CHAR(13) +CHAR(10) it was still appear 'ENTER'
> Here  I think I prevent all(after that I did not encounter with the
problem)
>  situations to have a 'ENTER'



> BEGIN

> END



> > Yes, you can use the CHAR() or NCHAR() function for that (depending on
> > whether you are using varchar or nvarchar). A carriage return is code
> > 13, a line feed 10. On a windows system you will get a CR plus a LF, so
> > CHAR(13)+CHAR(10). Use this with CHARINDEX or PATINDEX

> > Hope this helps,
> > Gert-Jan


> > > Hi

> > > I've a VARCHAR column that corresponds with multi-line textbox. The
> problem
> > > is that I need to extract the data into a textfile as a single line
text
> but
> > > there are "Enter" key in the data causing the extracted line to be
> > > multi-line too. Is there any method to detect those "Enter" key in the
> data?

> > > Thx

 
 
 

Detect "Enter" keycode in data

Post by Uri Diman » Tue, 18 Nov 2003 08:34:55


Hi
I did not mean 'Enter' as a word into a query.
You are confused because of quatations that i put ,sorry.



> The text 'ENTER' appears in Data?????



> > kriste
> > In addition to Gert's responce I have experienced with some situation
that
> > after perfoming  CHAR(13) +CHAR(10) it was still appear 'ENTER'
> > Here  I think I prevent all(after that I did not encounter with the
> problem)
> >  situations to have a 'ENTER'



> > BEGIN

> > END



> > > Yes, you can use the CHAR() or NCHAR() function for that (depending on
> > > whether you are using varchar or nvarchar). A carriage return is code
> > > 13, a line feed 10. On a windows system you will get a CR plus a LF,
so
> > > CHAR(13)+CHAR(10). Use this with CHARINDEX or PATINDEX

> > > Hope this helps,
> > > Gert-Jan


> > > > Hi

> > > > I've a VARCHAR column that corresponds with multi-line textbox. The
> > problem
> > > > is that I need to extract the data into a textfile as a single line
> text
> > but
> > > > there are "Enter" key in the data causing the extracted line to be
> > > > multi-line too. Is there any method to detect those "Enter" key in
the
> > data?

> > > > Thx