How to left or right justifying a text file
Results 1 to 3 of 3

Thread: How to left or right justifying a text file

  1. #1
    Join Date
    Jul 2003
    Posts
    14

    How to left or right justifying a text file

    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? Should I export to text directly from sql instead of passing the table information through VB.Net streamwriter? Thx.

    km

  2. #2
    JPnyc is offline Virtual PC Specialist!!!
    Join Date
    Jan 2005
    Posts
    7,877
    Well it's going to be viewed in some text reader and that's where the formatting would be done I think. I don't think there's any other way to format a text file. It will obey the settings in the text reader
    There is nothing to fear, but life itself.

  3. #3
    Join Date
    Feb 2000
    Location
    Idaho Falls, Idaho, USA
    Posts
    18,425
    If you are going to generate a text file with a .txt extension, the simple way to format it is to use your own code to place the text where you want it on each line, with spaces as needed. If the file is opened with Notepad, the default font is Courier, a fixed width font with all characters taking up the same amount of space, which will allow columns to line up easily. If you are putting the text into an HTML web page, use the Courier font or another fixed width font if you want to keep it simple.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •