Loading ...
Sorry, an error occurred while loading the content.

320Re: Smart/intelligent text formatting

Expand Messages
  • rpdooling
    Sep 26, 2005
    • 0 Attachment
      Alan,

      >>is there another script that can be run afterwords to remove the
      hard paragraph breaks at the end of each line?<<

      Never mind. Sorry. Select All. Join lines. Duh.

      Thanks for the tip on autoformat..

      Rick

      --- In ntb-scripts@yahoogroups.com, "rpdooling" <rpdooling@y...> wrote:
      > Dear Alan:
      >
      > The text::autoformat works great, but it puts a hard return at the end
      > of each line. Is there an option or something that can be set to avoid
      > that? Alternatively, is there another script that can be run
      > afterwords to remove the hard paragraph breaks at the end of each line?
      >
      > Thanks
      >
      > Rick
      >
      > --- In ntb-scripts@yahoogroups.com, "acummingsus" <acumming@c...> wrote:
      > > Text::Autoformat
      > >
      > > been using that Perl module on Linux. Impressive.
      > >
      > > http://search.cpan.org/~dconway/Text-Autoformat-
      > > 1.13/lib/Text/Autoformat.pm
      > >
      > > There's a bit of doc and what it will do.
      > >
      > > I just installed that module on my Win 2k and works super in Notetab.
      > >
      > > ppm equals perl package manager
      > >
      > > http://www.google.com/search?q=ppm+repositories
      > >
      > > bribes a ppm repository has Text-Autoformat (mine Windows Perl is
      > > Activestate Perl 5.8.X) (Additionally I also saw the module there for
      > > Perl 5.6.X)
      > >
      > > ppm> help
      > >
      > > ppm> help repository
      > >
      > > ppm> rep add bribes http_url_2_the_bribes_repo
      > >
      > > ppm> search text-autoformat
      > >
      > > ppm> install text-autoformat
      > >
      > > ppm> quit
      > >
      > > line length default of 72 char lines for now (well, 2 code lines R
      > > with "all" so U can comment the one and un comment the other line
      > > containing "all" which provides two choices of formatting). May
      > > develop it more with more choices, bells, and whistles. Two clips
      > > next:
      > >
      > > H="t_a_format"
      > > ^!RunPerl taform
      > >
      > > H="_taform"
      > > #!perl -w
      > >
      > > use strict;
      > > use Text::Autoformat;
      > > my $rawtext;
      > >
      > > # while (<DATA>) {
      > > while (<>) {
      > >
      > > $rawtext = "$rawtext$_";
      > >
      > > }
      > > # my $formatted = autoformat($rawtext, {left=>20, right=>60, all=>1});
      > > my $formatted = autoformat($rawtext, {all=>1});
      > > # my $formatted = autoformat $rawtext;
      > > print "$formatted\n";
      > > # print "\n$rawtext\n";
      > > # ----end----
      > >
      > > --
      > > Alan.
    • Show all 19 messages in this topic