Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: Substitution don't work with a special inputfile

by AnomalousMonk (Archbishop)
on Aug 24, 2015 at 18:55 UTC ( [id://1139732]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Substitution don't work with a special inputfile
in thread Substitution don't work with a special inputfile

$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:  <%-{-{-{-<

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1139732]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 07:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found