Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: process multiline text and print in desired format

by ak_mmx (Novice)
on Mar 18, 2021 at 01:49 UTC ( [id://11129876]=note: print w/replies, xml ) Need Help??


in reply to Re: process multiline text and print in desired format
in thread process multiline text and print in desired format

Thanks for the response, yes the input data can be few 1000 lines or more. I just pasted a portion to get an idea on how to approach the problem. Would you suggest other optimal solutions if input lines are more ? the script logic is likely not to change much though.
  • Comment on Re^2: process multiline text and print in desired format

Replies are listed 'Best First'.
Re^3: process multiline text and print in desired format
by jcb (Parson) on Mar 18, 2021 at 22:14 UTC

    More input is no problem; just change the script as indicated to read from a file instead and delete the __DATA__ section. The only problems would come if the script logic were to be embedded in a larger script because formats are a very old feature and have some limitations due to being far older than many of the features that support modern Perl programming. Most notably, formats can only access global variables and are themselves in a global namespace.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-16 23:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found