How to left or right justifying a text file

50 pts.
Tags:
SQL
text files
VB.NET
Hello programmers. I am using SQL to create a table from stored procedures and then streamwriter in VB.NET to create a text file based on the SQL table. Where and how do I control the right or left justification of the records in the text file? Thx.

Software/Hardware used:
sql server 7, windows xp, visual studio 2005

Answer Wiki

Thanks. We'll let you know when a new response is added.

1. There is no such thing as justification in plain text.

2. Using RTF (rich text) you might get the results you need. You might just find a standard 80 col width text file is easier to write to and create functions to align the text but if you want to use RTF then the syntax would be:

Alignment
\qc Centered.
\qj Justified.
\ql Left-aligned (the default).
\qr Right-aligned.
\qd Distributed.

More information about rtf can be found here.

Note this is Microsoft RTF 1.6 and you might want to look into a more platform independent version of this solution.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • mrozen
    I know what you are talking about. I don't know anything about computers but this has accidentally happened to me. Go to the open text document and right click.

    On the menu is a command: Right to Left Reading Order. Hit that to toggle it back to what you want.

    10 pointsBadges:
    report
  • ToddN2000
    You can try using the trim functions in SQL
    ex. LTRIM(RTRIM(SERIALNUMBER))
    59,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: