www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Perl's "format"

reply "Ben Hinkle" <bhinkle mathworks.com> writes:
Does anyone know of a D (or actually, C or C++ as well) equivalent to
Perl's "format" support for report and table generation? I know there are an
infinite number of ways to get printf and/or << to do similar things but
Perl does just what I want.

I'm looking for something like
  FancyPerlFormattingOutputStream s = ...
  s.header = r"Blah           Result";

  loop over data and
   s.write(str);
   s.write(num);

thanks,
-Ben
Jun 15 2004
parent James Widman <james jwidman.com> writes:
In article <cani0k$mj$1 digitaldaemon.com>,
 "Ben Hinkle" <bhinkle mathworks.com> wrote:

 Does anyone know of a D (or actually, C or C++ as well) equivalent to
 Perl's "format" support for report and table generation? I know there are an
 infinite number of ways to get printf and/or << to do similar things but
 Perl does just what I want.
Have you considered using Perl's C API in your D program? If not, feed these to your favorite command line interpreter: man perl man perlembed
Jun 16 2004