You don't show what you've tried so far, so I'll give you a general description of how I'd approach the problem. The problem can be split up into three parts:
The code for each part also is relatively self-contained:
#!perl -w use strict; # loop through the file while (<>) { print };
if (/^Article\b/) { s/\s*$//; # remove trailing whitespace and newlines print "Line [$_] is a heading."; };
$_ = "Article 1 News"; print "\\subsection*{$_}";
You'll have to assemble these parts into a coherent whole and/or ask questions about the parts that are still unclear to you. If you chose a different approach, it will help us to help you better if you show your approach.
In reply to Re: Simple Text Manipulation
by Corion
in thread Simple Text Manipulation
by pseingalt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |