- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need help on reading a xls file
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
05-25-2011 07:48 PM
05-25-2011 07:48 PM
Need help on reading a xls file
I need to read a .xls file. How will I be able to do it?
#uname -a
HP-UX filesvr B.11.23 U 9000/800 77929270 unlimited-user license
Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2011 10:41 PM
05-25-2011 10:41 PM
Re: Need help on reading a xls file
1. FTP the .xls file to a PC with Excel installed
2. Open the file in Excel
3. Read it
But then I guess when you said "read" a .xls file, you didn't mean read it yourself did you? Presumably you want to do something with the data in an Excel file? Without knowing what you want to do its difficult to say, but I'd imagine Perl would probably have something you need. You'll probably need to get an additional module for reading/converting excel data, so go to http://www.cpan.org and do a search on "excel" - that should throw up plenty of modules that will help.
And if you don't know Perl, what a great opportunity to learn!
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2011 11:41 PM
05-25-2011 11:41 PM
Re: Need help on reading a xls file
I don want to read a excel :)
I want my script to read excel.
I want to grep few words from my excel. How will I be able to do it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2011 02:18 AM
05-26-2011 02:18 AM
Re: Need help on reading a xls file
Then you'd get it in a nicely text-readable format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2011 03:09 AM
05-26-2011 03:09 AM
Re: Need help on reading a xls file
You need something that can understand the .xls format. Duncan already suggested using Perl and its modules.
For example, if you know the worksheet name and cell coordinates of the data you're looking for, the Perl module Spreadsheet::ParseExcel would be able to check exactly the cells you want.
But if you don't know where the words you search may be located within an Excel workbook file, it might be easier to use a converter like excel2txt or xls2csv to convert the Excel file to one or more text files (.txt or .csv), which could be then searched using standard Unix commands.
Links to above-mentioned Perl utilities:
http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.59/lib/Spreadsheet/ParseExcel.pm
http://search.cpan.org/~kclark/excel2txt/excel2txt
http://search.cpan.org/~ken/xls2csv-1.06/script/xls2csv
Instructions for installing Perl modules:
http://www.cpan.org/misc/cpan-faq.html#How_install_Perl_modules
http://perldoc.perl.org/cpan.html
http://perldoc.perl.org/perlmodinstall.html
As Johan said, if you can get the file in .csv format directly from the source, you could use Unix tools directly.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2011 05:14 AM
05-27-2011 05:14 AM
Re: Need help on reading a xls file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2011 09:34 AM
05-27-2011 09:34 AM
Re: Need help on reading a xls file
open the .xls file you want to view in hp-ux, save that file as "Text (Tab Delimited)" in save as dropdown. Ftp the file to the server in ascii mode. Then grep/more it in the server. You can view the file.
Note: you can view only the current sheet as per the above process.
Hope this helps.
Thanks
Vasanth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2011 07:13 PM
06-01-2011 07:13 PM
Re: Need help on reading a xls file
Is there anyway I can do the viceversa thing.
My script stores the output in a file which will be like a notepad.
I need to create columns in them and place contents in them in order like excel.
Is that possible to do that? What will help me do that?
Kindly help.
Sorry for the delay in assigning points.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2011 07:25 PM
06-01-2011 07:25 PM
Re: Need help on reading a xls file
As vasanth said, If I save I am able grep like that.Thanks vasanth!!
But My excel has got 5 sheets.
I need to save only 3rd sheet to be saved in that way.
Is there any possibility to do that through command line?
Kindly help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2011 07:26 PM
06-01-2011 07:26 PM
Re: Need help on reading a xls file
That's a question? Define "the viceversa
thing".
> My script stores the output in a file
> which will be like a notepad.
Showing some sample output might be more
helpful than a vague description.
> I need to create columns in them and place
> contents in them in order like excel.
Huh?
> Kindly help.
You first. What, exactly, are you trying to
do? Where? With what? Are you trying to
create a file which Excel can read?
I know approximately nothing about Excel, but
I suspect that it can read a file which
contains comma-separated values. Do you need
to do any more than add some commas to what
you store in your output file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2011 07:51 PM
06-01-2011 07:51 PM
Re: Need help on reading a xls file
My output is like below.
Time settings Done
TCP & IP Forwarding Done
User restriction - group Done
Service Restriction No
I need to arrange the them in two different columns with proper alignment.
I need the below lines to be in one column
Time settings
TCP & IP Forwarding
User restriction - group
Service Restriction
and the below line to be in column 2
Done
Done
Done
No
Both the columns should have proper separation, So that one can easily find which is done or not done on seeing the output.
Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2011 08:35 PM
06-01-2011 08:35 PM
Re: Need help on reading a xls file
Output from _what_?
> I need to arrange the them in two different
> columns with proper alignment.
So, do you want the output to look nice? And
this question has nothing to do with "a .xls
file"? (So why ask in this thread?)
> [...] in column 2
And where would you like column 2 to start in
the line? (How much space should column 1
occupy?) Most computers can't read your mind
any better than I can. You often need to
tell them _exactly_ what you want them to do.
Which means that you often first need to know
what you want done.
If you're creating this stuff in a shell
script, and you have the "printf" command,
then some alignment tasks can be pretty easy.
For example:
dyi # printf '%30s %s\n' 'Time settings' 'Done'
Time settings Done
dyi # printf '%-30s %s\n' 'Time settings' 'Done'
Time settings Done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2011 09:14 PM
06-01-2011 09:14 PM
Re: Need help on reading a xls file
I need my output actually to be in excel. Atlease I need them to be properly aligned, so that the output can be read easily without any confusion.
I am not able to understand the commands you have used. Can you please explain them?
Thanks!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2011 10:13 PM
06-01-2011 10:13 PM
Re: Need help on reading a xls file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2011 11:03 PM
06-01-2011 11:03 PM
Re: Need help on reading a xls file
Time Setting Done
Banner Done
Disable Direct root login Done
System stack non-execuatable Done
TCP & IP Forwarding Done
Removing files Done
Service Restriction No
UID 0 only for root No
User Restriction-group Done
User Session Timeout Done
Is there any possibility to draw a table to this?
I need the font to be in center alignment. Is there any command which helps me do this?
Thanks in Advance!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2011 11:36 PM
06-01-2011 11:36 PM
Re: Need help on reading a xls file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2011 12:04 AM
06-02-2011 12:04 AM
Re: Need help on reading a xls file
Is there any command in HP-UX which can help me create table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2011 01:08 AM
06-02-2011 01:08 AM
Re: Need help on reading a xls file
There is nroff(1) and tbl(1) but you may not want to go back to the formatting dark ages.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2011 04:48 AM
06-02-2011 04:48 AM
Re: Need help on reading a xls file
> Is there any command in HP-UX which can help me create table?
Go back and re-read Steven's comments about 'printf'. For that matter, read the Unix manpages regarding it.
> I need the font to be in center alignment. Is there any command which helps me do this?
Excel will allow you to format a column with left, right or center alignment. Why re-invent the wheel when clearly you are more comfortable with Excel rather than anything Unix.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2011 05:19 AM
06-02-2011 05:19 AM
Re: Need help on reading a xls file
I don't know what that means. Are you trying
to create a file which Excel can read, or are
you trying to create nice-looking output, or
what? Or don't you know?
> Output from _what_?
Still a mystery.
> Can you please explain them?
man printf
> Is there any possibility to draw a table to
> this?
I don't know what that means. Do you?
> > Kindly help.
>
> You first. What, exactly, are you trying to
> do? Where? With what? Are you trying to
> create a file which Excel can read?
Still wondering.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2011 10:00 PM
06-02-2011 10:00 PM
Re: Need help on reading a xls file
Thanks all!!