September 28, 2007 at 1:59 am
Hello all,
I have a question to you who are good at parsing text. I need to add row change with end of line tag to a ntext content. Basically the idea is that I could be able to extract a pre formatted text file from the ntext field.
I've discovered the tag from a existing text file with substring function and I have the tag or chars saved in a table for future use. That is not the most beautiful way of doing it though.
Any tips?
Ilkka
September 28, 2007 at 4:24 am
Are you looking for something similar to this?
select'Hello' + char(13) + char(10) + 'and goodbye'
------------------
Hello
and goodbye
(1 row(s) affected)
/Kenneth
October 8, 2007 at 4:57 am
Yeah that does the trick! Thanks. But I do not really understand what they do and what those char(10) and char(13) stand for? Is there more usable char(?) special tags and how can I find some descriptions on them?
Ilkka
October 8, 2007 at 6:44 am
char 13 is a Carriage Return (vbCr) also known as
char 10 is a Line Feed (vbLf) also known as \r (i think)
in most PC based files, you'll find vbCrLf as the End of Line marker, however UNIX based files will only have vbLf;
if you BULK INSERT from a unix file using the , you'll get wierd results, and need to change the rowterminator for the format.
Lowell
October 8, 2007 at 2:49 pm
Ilkka Vaahtoranta (10/8/2007)
Yeah that does the trick! Thanks. But I do not really understand what they do and what those char(10) and char(13) stand for? Is there more usable char(?) special tags and how can I find some descriptions on them?Ilkka
Probably this can help:
_____________
Code for TallyGenerator
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply