LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-24-2014, 06:10 PM   #1
atjurhs
Member
 
Registered: Aug 2012
Posts: 168

Rep: Reputation: Disabled
csv to excel with a script?


hi guys,

is there a way to change csv files to excel files with a script?

i have a code that has to have windows xls files (stupid windows) to run. and i have a bunch of csv files that i need to input to that code. is there an easy way to convert them with some sort of a script? i googled and found a pearl and a python script that say they can but i don't know either of those. thanks to you guys i'm a bit better at awk sed and bash scripting

thanks much guys,

tabby
 
Old 11-24-2014, 06:13 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,014

Rep: Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535
Can you convert CSV to Excel with just Awk, Sed and BASH?

No.
 
Old 11-24-2014, 06:49 PM   #3
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,493

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Open/Libre office can do this. There are many examples on how to export CSV or PDF from Calc, so opening CSV and saving as XLS must be possible as well. Those examples are in the OO forums. It is even possible to call Calc on the command line and have that script executed.

That having said, I learned Calc scripting is complicated and not portable from one version to the next.

jlinkels
 
Old 11-24-2014, 07:38 PM   #4
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,255

Rep: Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686Reputation: 2686
Excel can natively open csv files.

You say you 'have a code'. Are you able to elaborate? Is this a VB script? Are you able to edit this code?

It seems a little odd that we are going to linux to convert files that are then going to be used by an alternate source.
As loathed as I am to work in Windows it may just be easier to do all the coding there.
 
Old 11-24-2014, 07:57 PM   #5
atjurhs
Member
 
Registered: Aug 2012
Posts: 168

Original Poster
Rep: Reputation: Disabled
all the csv "input files" (that i need to covert) are on a linux box.

the wndows code takes only excel files as input and they need to have a couple of worksheets (each worksheet from one of the csv files). it is a hodge podge of c++ python and vb. the last guy to work on it quit (too low of pay working for a non-profit). vb i could maybe somewhat mess with but not the other two and i don't know how they are all linked together???

looks like i'm screwed and may have to create each xls by hand???

tabby
 
Old 11-24-2014, 08:07 PM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 7,014

Rep: Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535Reputation: 2535
Given a choice, I'd honestly do it on Windows and convert them to Excel with Excel. Excel's scripting language can automate that. Including the creation of the two worksheets.

The next best thing, is, as jlinkels mentioned, scripting it with OpenOffice or LibreOffice.

Last edited by dugan; 11-24-2014 at 08:09 PM.
 
Old 11-24-2014, 08:39 PM   #7
atjurhs
Member
 
Registered: Aug 2012
Posts: 168

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dugan View Post
Given a choice, I'd honestly do it on Windows and convert them to Excel with Excel. Excel's scripting language can automate that. Including the creation of the two worksheets.

The next best thing, is, as jlinkels mentioned, scripting it with OpenOffice or LibreOffice.
thanks guys, i'll give it a try muah

tabby
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
csv to excel ust Linux - Newbie 12 02-17-2011 11:32 PM
Odd grep problem with Excel CSV saltz Programming 1 07-23-2009 10:23 PM
convert excel to csv and html thelonius Programming 3 03-28-2007 12:16 PM
excel to csv generator shweta Linux - Software 2 09-08-2006 08:03 AM
Culling Data from a CSV file to output in excel jterr02 Programming 2 05-19-2006 05:58 AM


All times are GMT -5. The time now is 12:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration