in reply to Re^2: How to print certain lines out of a text file.
in thread How to print certain lines out of a text file.
I check the line in the file to see if it has the pattern in it (HW/OS/Client) and if it does, I want to print that line and then keep printing each subsequent line until the (blank line) is reached. Exit that loop and go back to the main loop to look for another iteration of "Policy Name:". Keep doing this through all 122 backup policies.Policy Name: Backup_Monday Active: Yes Type: Normal ----- more various garbage in between ----- Granular Restore Info: No HW/OS/Client: PC Windows2003 ds1 PC Windows2003 ds2 PC Windows2003 ds3 PC Windows2003 ds4 PC Windows2000 ds5 PC Windows2000 ds6 (blank line here) (text file continues on to other policies in the file from here)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to print certain lines out of a text file.
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 | |
|
Re^4: How to print certain lines out of a text file.
by sawdustar (Novice) on Jul 31, 2010 at 22:53 UTC | |
by repellent (Priest) on Aug 01, 2010 at 05:14 UTC | |
|
Re^4: How to print certain lines out of a text file.
by sawdustar (Novice) on Aug 06, 2010 at 17:00 UTC |