- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Converting csv to xls using raw unix shell script
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
Discussions
Discussions
Discussions
Forums
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
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
тАО07-06-2009 08:35 AM
тАО07-06-2009 08:35 AM
Converting csv to xls using raw unix shell script
I know about some perl module which can do this.
But I dont have root access to install those modules.
Thus want some idea how we can do that by unix shell scripting only.
Thanks for your help in advance.
Regards,
Hasim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 08:41 AM
тАО07-06-2009 08:41 AM
Re: Converting csv to xls using raw unix shell script
> I know about some perl module which can do this. But I dont have root access to install those modules. Thus want some idea how we can do that by unix shell scripting only.
I'm glad that you know about Perl and its modules. Not having root access to install them should not be a deterrent. Either ask your system administrator to do this for you; _OR_ install them in your ${HOME} directory. By default, Perl includes your current path in @INC.
Doing this without the Perl module support is not going to be trivial.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 08:56 AM
тАО07-06-2009 08:56 AM
Re: Converting csv to xls using raw unix shell script
If you have an application which gets its input from xls files, then you might want to consider using something like authotkey to open this document in excel and saving it as xls file on the PC side. Look for *.ahk scripts flourishing around the web for that.
I am sorry but as JRF also said, tackling Microsoft's proprietary binary formats is not a picnic in the park.
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 11:51 AM
тАО07-06-2009 11:51 AM
Re: Converting csv to xls using raw unix shell script
read that as "just plain ugly".
and just for fun, yahoo turns up 450,000+ hits on "unix convert csv to xls", the first two pages of which actually talk about going from xls to csv...
somebody already did the work in a perl module, it makes sense to use that (if you absolutely have to do the conversion).
As previously noted, with most later installations, double clicking a .csv file will cause it to open in Excel anyway, so I don't see much advantage to doing this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2009 12:04 PM
тАО07-06-2009 12:04 PM
Re: Converting csv to xls using raw unix shell script
...and I misread this as a CSV format to XML (instead of XLS, since after all this is UNIX), so as Mel said, just import your file into M$ Excel and be done!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-07-2009 02:42 AM
тАО07-07-2009 02:42 AM
Re: Converting csv to xls using raw unix shell script
* Double-click on the CSV file
* Open .CSV file from Excel
* Data->import from Excel
The first two will incorrectly ignore all quotation and do conversions you don't want or expect
1,"12-11-2009",booz
will translate the second field to Dec/11/2009, something obviously NOT intended (it's quoted, right, it is a string).
When using (perl) scripts to convert CSV to XLS, those things can easily be controlled.
My module Spreadsheet::Read comes with a csv2xls convertor with many options.
As others already mentioned, you don't need root access to install them
$ export PERL5LIB=$HOME/perl5/lib:$HOMe/perl5/arch
might be all you need to access your modules installed in ~/perl5
HTH, Enjoy, Have FUN! H.Merijn