right justify a text file

This is a discussion on right justify a text file within the C++ Programming forums, part of the General Programming Boards category; Does anybody know how you would right justify a text file?...

  1. #1
    Unregistered
    Guest

    Unhappy right justify a text file

    Does anybody know how you would right justify a text file?

  2. #2
    Linguistic Engineer... doubleanti's Avatar
    Join Date
    Aug 2001
    Location
    CA
    Posts
    2,459
    first i'd check the file to see if every line only consisted of 80 characters per line. [which would be the usual right justification, seeing as how it comes from the ole' 80x25 text display we know and love]. then for each line i'd see how long it was, and prepend the remaining space to each line in order to make every line 80 chracters long, and thus right justifying it...
    hasafraggin shizigishin oppashigger...

  3. #3
    _B-L-U-E_ Betazep's Avatar
    Join Date
    Aug 2001
    Posts
    1,412
    You can't really.

    Take notepad for example. There is no right justify. You could count the number of spaces in an open notepad on your desktop and place spaces before a set 'count' of characters then a newline and do the same until your data has ended... but if you modified the notepad window size, your data would look all choppy(wordwrap or not). You would also have to take into account that you wouldn't want to return in the middle of a word....

    You could create a .html file that has text right justified that would open in a browser.

    But a text file...

    no go.

    edit...

    if you are opening the text file in a dos console with 'edit', you can do like I said while using DA's recommendations for an 80 character line display....
    Last edited by Betazep; 02-11-2002 at 12:21 AM.
    Blue

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  2. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  3. struct question
    By caduardo21 in forum Windows Programming
    Replies: 5
    Last Post: 01-31-2005, 03:49 PM
  4. Simple File encryption
    By caroundw5h in forum C Programming
    Replies: 2
    Last Post: 10-13-2004, 10:51 PM
  5. what does this mean to you?
    By pkananen in forum C++ Programming
    Replies: 8
    Last Post: 02-04-2002, 02:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21