linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J." <mailing-lists@xs4all.nl>
To: linux-c-programming@vger.kernel.org
Subject: printf(), aligning fields
Date: Sat, 23 Aug 2003 22:31:26 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.21.0308232217220.23476-100000@hestia> (raw)
In-Reply-To: <Pine.LNX.4.44.0308222010400.17321-100000@praktifix.dwd.de>

Hello,

I am trying to print collums from a c program, as the
following example illustrates:

  Total  Number   Folder
  -----  ------   ------
  15502   17      cronlog
  189897  42      linux/debian-curiosa
  161751  32      linux/debian-firewall
   4305   1       linux/debian-general
  17431   1       linux/debian-news
  107517  1       linux/vger-kernel-announce
  61136   16      linux/vger-kernel-c-programming
   8580   2       linux/vger-kernel-gcc

How can I can align the output to the max right field boundry without
overcrossing that field boundry if the field value gets longer?

Do I really have to check the length of the value before printing it with,
%*s, and then determine how many spaces I need? 

Thnkx...

JM


  reply	other threads:[~2003-08-23 20:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-21 12:48 Question about checksums Holger Kiehl
2003-08-21 13:20 ` Luciano Miguel Ferreira Rocha
2003-08-21 16:36   ` Holger Kiehl
2003-08-21 17:28     ` Jeff Woods
2003-08-22 20:18       ` Holger Kiehl
2003-08-23 20:31         ` J. [this message]
2003-08-24  0:07           ` printf(), aligning fields Glynn Clements
2003-08-24  1:05             ` Stephen Satchell
2003-08-21 18:19     ` Question about checksums Luciano Miguel Ferreira Rocha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.21.0308232217220.23476-100000@hestia \
    --to=mailing-lists@xs4all.nl \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).