For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > February 2006 > working with NTBackup Logfiles: backup##.log









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author working with NTBackup Logfiles: backup##.log
Marcel

2006-02-21, 7:55 am

I am having problems working with the logfiles created by ntbackup.
They open in "vi" and with "cat".
But they seem to be binary when looking at them with "less" or trying
to put the content into an array.
When printing the Array all I get is: "=FF=FES"
Couldn't find anything in this group so far that would at least give me
a hint on how to convert or read the file.

Any suggestions?


Thanks already in advance,
Marcel

MSG

2006-02-21, 6:57 pm


Marcel wrote:
> I am having problems working with the logfiles created by ntbackup.
> They open in "vi" and with "cat".
> But they seem to be binary when looking at them with "less" or trying
> to put the content into an array.
> When printing the Array all I get is: "=FF=FES"
> Couldn't find anything in this group so far that would at least give me
> a hint on how to convert or read the file.
>
> Any suggestions?
>
>
> Thanks already in advance,
> Marcel


They are Unicode files.
perldoc perluniintro

Marcel

2006-02-22, 3:55 am

Thanks for the Tip.
I figured out how to print it, but I am still having trouble sending
the Text via SMTP (Net::SMTP).
All I retrieve as recipient is "nothing" / just an empty mail.
I guess I still have to convert the unicode into something else (maybe
latin1).
But how? I gave it a try with recode and the sample sub in perldoc
perluniintro. But neither one did the job.

Marcel

MSG

2006-02-23, 3:55 am

Marcel wrote:
> Thanks for the Tip.
> I figured out how to print it, but I am still having trouble sending
> the Text via SMTP (Net::SMTP).
> All I retrieve as recipient is "nothing" / just an empty mail.
> I guess I still have to convert the unicode into something else (maybe
> latin1).
> But how? I gave it a try with recode and the sample sub in perldoc
> perluniintro. But neither one did the job.
>
> Marcel


Perl natively uses utf-8, Windows utf-16. email uses probably some
variant of ASCII, ( Check your email header for Content-Type. One of
mine says: "Content-Type: text/plain; charset=US-ASCII" ), plus you
have both ends (sender and recipient) to worry about...

Is that enough yet to keep you busy? :-)

I would convert the log files to ASCII from the get-go ( using Perl or
a
DOS batch file). I doubt you will lose any information if you are using
an English verision of Windows.

Marcel

2006-02-23, 7:55 am

Thanks for your help Oliver!
Got it up and running.

Following did the trick:
open (IN, "<:encoding(utf16)", "$file") or die "$!";
open (OUT, ">:encoding(iso-8859-1)", "$file.out") or die "$!";
print OUT <IN>;

regards,
Marcel

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com