HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Need Help in writing PERL code for following -
Operating System - Linux
1827705
Members
2847
Online
109967
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2008 07:22 PM
01-28-2008 07:22 PM
Need Help in writing PERL code for following -
Hi, I am opening a file whose original format is :
===============================================
USHER2K3FS02_POL
1/3/2008 11:29:14 PM
209
200
3607
1
0
0
0
79
10615
0
\\USHER2K3FS02\FS02$
\\USHER2K3FS02
1
USHER2K3FS02_POL
1/3/2008 11:03:28 PM
1546
200
1849461
70
0
0
0
2181
37835
0
\\USHER2K3FS02\FS01$
\\USHER2K3FS02
1
===============================================
But when I am trying to print samething via perl code, its giving different output :
Perl code is :
open BEXREPORT, " or Fatal ("Cannot open Backup Exec Report: $!");
foreach $line () {
chomp($line); # remove the newline from $line.
print "$line";
}
==============================================
Output is :
C:\test>perl xyz.pl
■< ? x m l v e r s i o n = " 1 . 0 " e n c o d i n g = " u t f - 1 6 " ? >
< P o l i c y N a m e > U S H E R 2 K 3 F S 0 2 _ P O L < / P o
< A c t u a l S t a r t T i m e > 1 / 3 / 2 0 0 8 1 1 : 2 9 :
< E l a p s e d T i m e S e c o n d s > 2 0 9 < / E l a p s e d
< D a t a S i z e K B y t e s > 3 6 0 7 < / D a t a S i z e K B
< H a s S k i p p e d F i l e s > 0 < / H a s S k i p p e d F i
< H a s C o r r u p t F i l e s > 0 < / H a s C o r r u p t F i
< H a s I n u s e F i l e s > 0 < / H a s I n u s e F i l e s >
< N u m b e r O f F i l e s > 7 9 < / N u m b e r O f F i l e s
< N u m b e r O f D i r e c t o r i e s > 1 0 6 1 5 < / N u m b
< R e s o u r c e N a m e > \ \ U S H E R 2 K 3 F S 0 2 \ F S 0
< S e r v e r N a m e > \ \ U S H E R 2 K 3 F S 0 2 < / S e r v
< R e s o u r c e T y p e I D > 1 < / R e s o u r c e T y p e I
< P o l i c y N a m e > U S H E R 2 K 3 F S 0 2 _ P O L < / P o
< A c t u a l S t a r t T i m e > 1 / 3 / 2 0 0 8 1 1 : 0 3 :
< E l a p s e d T i m e S e c o n d s > 1 5 4 6 < / E l a p s e
< D a t a S i z e K B y t e s > 1 8 4 9 4 6 1 < / D a t a S i z
< H a s S k i p p e d F i l e s > 0 < / H a s S k i p p e d F i
< H a s C o r r u p t F i l e s > 0 < / H a s C o r r u p t F i
< H a s I n u s e F i l e s > 0 < / H a s I n u s e F i l e s >
< N u m b e r O f F i l e s > 2 1 8 1 < / N u m b e r O f F i l
< N u m b e r O f D i r e c t o r i e s > 3 7 8 3 5 < / N u m b
< R e s o u r c e N a m e > \ \ U S H E R 2 K 3 F S 0 2 \ F S 0
< S e r v e r N a m e > \ \ U S H E R 2 K 3 F S 0 2 < / S e r v
< R e s o u r c e T y p e I D > 1 < / R e s o u r c e T y p e I
< / D a t a S e t > t D a i l y P o l i c y J o b s B y R e s o u r c e >
C:\test>
===============================================
Because of this I am not able to grep for something...and do further processing...
===============================================
===============================================
But when I am trying to print samething via perl code, its giving different output :
Perl code is :
open BEXREPORT, "
foreach $line (
chomp($line); # remove the newline from $line.
print "$line";
}
==============================================
Output is :
C:\test>perl xyz.pl
■< ? x m l v e r s i o n = " 1 . 0 " e n c o d i n g = " u t f - 1 6 " ? >
< P o l i c y N a m e > U S H E R 2 K 3 F S 0 2 _ P O L < / P o
< A c t u a l S t a r t T i m e > 1 / 3 / 2 0 0 8 1 1 : 2 9 :
< E l a p s e d T i m e S e c o n d s > 2 0 9 < / E l a p s e d
< D a t a S i z e K B y t e s > 3 6 0 7 < / D a t a S i z e K B
< H a s S k i p p e d F i l e s > 0 < / H a s S k i p p e d F i
< H a s C o r r u p t F i l e s > 0 < / H a s C o r r u p t F i
< H a s I n u s e F i l e s > 0 < / H a s I n u s e F i l e s >
< N u m b e r O f F i l e s > 7 9 < / N u m b e r O f F i l e s
< N u m b e r O f D i r e c t o r i e s > 1 0 6 1 5 < / N u m b
< R e s o u r c e N a m e > \ \ U S H E R 2 K 3 F S 0 2 \ F S 0
< S e r v e r N a m e > \ \ U S H E R 2 K 3 F S 0 2 < / S e r v
< R e s o u r c e T y p e I D > 1 < / R e s o u r c e T y p e I
< P o l i c y N a m e > U S H E R 2 K 3 F S 0 2 _ P O L < / P o
< A c t u a l S t a r t T i m e > 1 / 3 / 2 0 0 8 1 1 : 0 3 :
< E l a p s e d T i m e S e c o n d s > 1 5 4 6 < / E l a p s e
< D a t a S i z e K B y t e s > 1 8 4 9 4 6 1 < / D a t a S i z
< H a s S k i p p e d F i l e s > 0 < / H a s S k i p p e d F i
< H a s C o r r u p t F i l e s > 0 < / H a s C o r r u p t F i
< H a s I n u s e F i l e s > 0 < / H a s I n u s e F i l e s >
< N u m b e r O f F i l e s > 2 1 8 1 < / N u m b e r O f F i l
< N u m b e r O f D i r e c t o r i e s > 3 7 8 3 5 < / N u m b
< R e s o u r c e N a m e > \ \ U S H E R 2 K 3 F S 0 2 \ F S 0
< S e r v e r N a m e > \ \ U S H E R 2 K 3 F S 0 2 < / S e r v
< R e s o u r c e T y p e I D > 1 < / R e s o u r c e T y p e I
< / D a t a S e t > t D a i l y P o l i c y J o b s B y R e s o u r c e >
C:\test>
===============================================
Because of this I am not able to grep for something...and do further processing...
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2008 10:26 PM
01-28-2008 10:26 PM
Re: Need Help in writing PERL code for following -
Your answer is right there on the first line:
You need to make sure that you're reading it in a unicode friendly mode. Something like:
use encoding utf16;
open ...
See the man pages for more (man perlunicode).
You need to make sure that you're reading it in a unicode friendly mode. Something like:
use encoding utf16;
open ...
See the man pages for more (man perlunicode).
One long-haired git at your service...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2008 03:32 AM
01-30-2008 03:32 AM
Re: Need Help in writing PERL code for following -
Try using the XML::Simple module for XML parsing. very simple and very useful.
Leonid.
Leonid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2008 01:25 AM
01-31-2008 01:25 AM
Re: Need Help in writing PERL code for following -
i also propose to use the XML modules from perl, it's easy, reliable and fast.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP