in reply to Re^2: Replacement and conversion of flat file text documents
in thread Replacement and conversion of flat file text documents

If you're new to Programming, then you have a little longer journey .. but if I were going to distill Programming into a little recipe, it would be something like this:

The three features you've listed are

Is this right?

I'll check back in a bit.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re^4: Replacement and conversion of flat file text documents
by imhotep (Novice) on Apr 18, 2005 at 17:38 UTC
    Thanks alex (also my middle name) for getting back to me!

    Yes that is what I have to do!

    I have this,

    #!/usr/bin/perl use English; use diagnostics; print "html body\n"; while ($line = <>) { if ($line =~ m/Emma [[:punct:]]/) { print "h2 $line h2\n"; } if ($line =~ m/CHAPTER (.*)/) { print "h2 $line h2\n"; } if ($line =~ m/Jane Austen/) { print "h2 $line h2\n"; } if ($line =~ m/VOLUME (.*)/) { print "h2 $line h2\n"; } if ( not ( $line =~ m/Jane Austen/) ) { if ( not ( $line =~ m/Emma [[:punct:]]/)) { if ( not ( $line =~ m/CHAPTER (.*)/)) { if ( not ( $line =~ m/VOLUME (.*)/)) { $line =~ s|\b_|<i>|g; $line =~ s|_\b|</i>|g; print $line; } } } } } print "body html\n";
    This should do everything but not the paragraph elements! Any guidance would be great! I have left out the "<" brackets so that it will display properly

    Edit by tye: Add CODE tags