Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

export to text file with char(13)

export to text file with char(13)

export to text file with char(13)


I need to export this table to a text file.  Here is how the table was created:

Select  row_id+
from my table

With Char(13), it should split the data into 2 rows per record.  However, after I export the table using DTS, it showed only one long row per record.  What am I doing wrong?  Was using Char(13) incorrect?

Note that row_id showed twice.


RE: export to text file with char(13)

What column does the char 13 refer to? In that code, you are getting one long string for each row because you have + as opposed to ,

What you could do is something like the below, but only as a rough guide (using substrings)


select rownum, col2, substring (text, 1, 13)
from ml
select rownum, col2, substring (text, 14, 255)
from ml
order by rownum

replace the table name, field names etc. ant where I have the field "text" in brackets, change that to the one you are trying to split.

RE: export to text file with char(13)


RE: export to text file with char(13)


Thank you again.  You have save my day.  I was going to write a more complex code.  First, I thought your code doesn't work, but after a while it starts to make sense.


RE: export to text file with char(13)

Without seeing any sample data I just took a guess. Not sure of your fields / data types etc. so was just a quick knock-up. Glad to help / at least give you a pointer.

Good Luck!!!



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close