Syntactic Confectionery Delight | |
PerlMonks |
Re^5: Substitution don't work with a special inputfileby AnomalousMonk (Archbishop) |
on Aug 24, 2015 at 18:55 UTC ( [id://1139732]=note: print w/replies, xml ) | Need Help?? |
$line =~ s/\n/ /g; I don't understand this statement in poj's code: why are all newlines being changed to spaces? $line =~ s/ (\d+\. )/\n$1/g; This statement seems to speak to a requirement to add newlines before every 1. 23. 345. pattern, but I can't see where this has ever been discussed before. Please give more info on this. It would help if you could post a short example of an input file and a corresponding file representing the exact output you want from it. By short, I mean that most of the data in the input file you have already posted seems redundant; please try to keep example data short and sweet. And once again, the statement that the result of a piece of code is "no good" is not helpful; in what way is it no good? You should say "With this code and this input data, I want to get 'XXX' and I am getting 'YYY'." Give a man a fish: <%-{-{-{-<
In Section
Seekers of Perl Wisdom
|
|