Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Perl: Extracting specific text from a .txt file and outputting into a new format

by ragingwhisky (Initiate)
on Nov 18, 2010 at 10:37 UTC ( #872188=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    System : system001-server 
    (System name differs by number only system001..., system002..., system
    +003 e.t.c)
    Description : example_system_server_round
    (Description name varies, capturing the name after "Description" only 
  2. or download this
    while (<IN>) { 
    if (m/Server*Example/ig) { 
    print OUT $_, "\n"; 
    print $_; } 
  3. or download this
    System : system001-server 
    Box : HW a2b 1234Mb 123.4, address is 0012.d345.1234 (abc 0012.d123 +.
    ByteIn : 3385567095904 
    Byteout : 5816943852464 
    Description : example_system_server_example
  4. or download this
    system001-server,HW a2b 1234Mb 123.4, address is 0012.d345.1234 (abc 0
    + +012.d123.4567),3385567095904,5816943852464,example_system_server_ex
    +am +ple
  5. or download this
    log example (from .txt file):
    GigabitEthernet7/2 is up, line protocol is up (connected)
    HW a2b.........

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://872188]
Approved by marto
Front-paged by biohisham
[marto]: Corion, not to worry, it was ok :)
[Corion]: I "just" had a call from a friend whom I host the website for, and they were quite hectic yet uninformed about what they'd have to change for GDPR... This felt like work to me, but at least I got that call in a café, not in the office
[Corion]: But hopefully today I'll be a bit calmer and call them and update their website with what little they need to change for GDPR. Having a "business front page" as website means you collect and handle very little PII ;)
[marto]: I've yet to do my mandatory training, GDPR is purely focused at businesses?
[marto]: there's just so much FUD
[choroba]: we had the training yesterday
[hippo]: GDPR applies to everyone but there is an exception for individuals keeping records of their own personal activities.
[hippo]: The full monty

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2018-05-22 07:55 GMT
Find Nodes?
    Voting Booth?