What did you try? Is there a rule for where to insert new lines? It's a fairly trivial operation using regular expressions. For example, inserting new lines before semicolons could be done with
#!/usr/bin/perl use warnings; use strict; my $text = <<EOT; xxx ; xxx { xxx } xxx ( xxx ; xxx' EOT $text =~ s/(?=;)/\n/g; print $text;
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In reply to Re: inserting new lines
by kennethk
in thread inserting new lines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |