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

Replies are listed 'Best First'.
Re: Parsing output
by Abigail-II (Bishop) on Apr 23, 2003 at 00:49 UTC
    Not enough input. Given that most characters are allowed in file names, it's impossible to know how to extract them. It would be as hard as extracting file names from free text.

    You need to find out more about the structure of the NetBackup log file.


      I will research more. Thanks!!!
Re: Parsing output
by Solo (Deacon) on Apr 23, 2003 at 02:10 UTC
    What happens to the archive bit on the files that fail vs. the ones that are successfully backed up?

    Bring them on! I prefer a straight fight to all this sneaking around.

      I will look into that as well! Thanks!
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

      I thought I might need to separate fields. Thanks.
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 It analyzes which file systems (if any) are backed up.

    HTH, Valerio

      I will look at that some more. Thanks.