J
jason
Hello.
I just converted some data to to sql2000 into a TEXT type field. I
needed to remove all tabs from the data and now want to remove extra
lines too.
As we know, SQL2000's replace function does not work on TEXT types. So
I've written a simple asp.net program (with very high timeouts) that
allows me to replace strings in these very large Text fields. I loop
through the table and am able to replace any strings I want except I
can't seem to figure out how to replace extra blank lines with a
single line feed and carriage return.
Comparing the old data to the new data. I see I have extra hex values
between lines of
old = 0D0A
new = 0D0A0D0A
so I'm looking to replace 0D0A0D0A with 0D0A.
Here's the asp.net (VB) I have tried. None yeild the change:
dim thebody as string
thebody=thebody.replace(chr(13)+chr(10)+chr(13)+chr(10),chr(13)+chr(10))
thebody=thebody.replace(chr(13)&chr(10)&chr(13)&chr(10),chr(13)&chr(10))
thebody=thebody.replace(vbCrLf&vbCrLf,vbCrLf)
Again, the same logic does replace any other string including Tab =
chr(9)
Thanks for any help or info!
I just converted some data to to sql2000 into a TEXT type field. I
needed to remove all tabs from the data and now want to remove extra
lines too.
As we know, SQL2000's replace function does not work on TEXT types. So
I've written a simple asp.net program (with very high timeouts) that
allows me to replace strings in these very large Text fields. I loop
through the table and am able to replace any strings I want except I
can't seem to figure out how to replace extra blank lines with a
single line feed and carriage return.
Comparing the old data to the new data. I see I have extra hex values
between lines of
old = 0D0A
new = 0D0A0D0A
so I'm looking to replace 0D0A0D0A with 0D0A.
Here's the asp.net (VB) I have tried. None yeild the change:
dim thebody as string
thebody=thebody.replace(chr(13)+chr(10)+chr(13)+chr(10),chr(13)+chr(10))
thebody=thebody.replace(chr(13)&chr(10)&chr(13)&chr(10),chr(13)&chr(10))
thebody=thebody.replace(vbCrLf&vbCrLf,vbCrLf)
Again, the same logic does replace any other string including Tab =
chr(9)
Thanks for any help or info!