gio has asked for the wisdom of the Perl Monks concerning the following question:
All,
I am trying to extract a list of file paths (ie.. C:\Winnt\system32\) which have errored in NetBackup so that I can automatically have them rerun in a script. The file paths which errored are not always listed in the same field in the output. The files always start with a capital letter followed by a colon. The output is one long line of fields of text. Some file paths have spaces in them so I can't use spaces as a delimiter. How can I use Perl to extract this info?
Many Thanks!!!!
Gio
Re: Parsing output
by Abigail-II (Bishop) on Apr 23, 2003 at 00:49 UTC
|
| [reply] |
|
I will research more. Thanks!!!
| [reply] |
Re: Parsing output
by Solo (Deacon) on Apr 23, 2003 at 02:10 UTC
|
| [reply] |
|
I will look into that as well! Thanks!
| [reply] |
Re: Parsing output
by TVSET (Chaplain) on Apr 23, 2003 at 07:15 UTC
|
You can use multicharacter patterns to separate fields. If you are talking about filename on a Windoze host, I'd use something like (not tested):
$line = "C:\Winnt\system32\a.exe C:\Winnt\system32\b.exe D:\Files\blah
+.exe";
@files = split(#[C-Z]:\#, $line);
Leonid Mamtchenkov | [reply] [d/l] |
|
I thought I might need to separate fields. Thanks.
| [reply] |
Re: Parsing output
by valdez (Monsignor) on Apr 23, 2003 at 12:50 UTC
|
Disclaimer: I've never used NetBackup.
There is a distribution called NBU on CPAN which includes a script named coverage.pl. It analyzes which file systems (if any) are backed up.
HTH, Valerio
| [reply] |
|
I will look at that some more. Thanks.
| [reply] |
|