in reply to How to print certain lines out of a text file.
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { next unless /^HW\/OS\/Client:/ .. /^$/; next if /^$/; print; } __DATA__ Greetings, New here. Just learning Perl too. :-) I'm parsing through a test file. I need to parse through the text file until I find HW/OS/Client print that line and then print each subsequent line of "clients" until the line read from the text file is blank. The text section in this very large text file looks HW/OS/Client: PC Windows2003 server1 PC Windows2003 server2 PC Windows2003 server3 PC Windows2003 server4 PC Windows2000 server5 PC Windows2000 server6 blah blah, blah blah blah, blah blah blah, blah blah blah, blah
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to print certain lines out of a text file.
by sawdustar (Novice) on Jul 31, 2010 at 18:36 UTC | |
by sawdustar (Novice) on Jul 31, 2010 at 19:19 UTC | |
by graff (Chancellor) on Jul 31, 2010 at 22:33 UTC | |
by sawdustar (Novice) on Jul 31, 2010 at 22:48 UTC | |
by graff (Chancellor) on Jul 31, 2010 at 23:08 UTC | |
by sawdustar (Novice) on Jul 31, 2010 at 22:53 UTC | |
by repellent (Priest) on Aug 01, 2010 at 05:14 UTC | |
by sawdustar (Novice) on Aug 06, 2010 at 17:00 UTC |