LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-25-2017, 06:21 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
Converting CSV to XLS (using console)?


Hello,

Would you eventually know the best method to convert a CSV file to XLS (using console)?

The data are with "." for decimals.

Is libreoffice the best way? It looks to me over sized for simple thing.

X. Thank you
 
Old 01-25-2017, 06:23 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
wow... the first result on Google.... http://unix.stackexchange.com/questi...-file-on-linux
 
1 members found this post helpful.
Old 01-25-2017, 06:36 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,308
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by TenTenths View Post
wow... the first result on Google....
TenTenths, spot on with the link, but just as a point of information for the past 8 or 9 years, Google shows different results to different users. So a different account even on the same computer will likely have a different marketing profile and thus different results. It's been longer than that if you count the search results given in separate countries.

But that aside, Xeratul, what are the goals of converting from CSV? Even clunky legacy applications like Excel can import CSV directly. Are you running in to problems with the end-of-line characters and need the unix2dos utility?
 
Old 01-25-2017, 07:45 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by Turbocapitalist View Post
TenTenths, spot on with the link, but just as a point of information for the past 8 or 9 years, Google shows different results to different users. So a different account even on the same computer will likely have a different marketing profile and thus different results. It's been longer than that if you count the search results given in separate countries.
Indeed, I'm well aware that Google results are tailored, however I'm sure that, no matter where in the world the OP is (or maybe even in space, the ISS has internet connectivity!), a search would turn up relevant results.
 
Old 01-25-2017, 12:40 PM   #5
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by Turbocapitalist View Post
TenTenths, spot on with the link, but just as a point of information for the past 8 or 9 years, Google shows different results to different users. So a different account even on the same computer will likely have a different marketing profile and thus different results. It's been longer than that if you count the search results given in separate countries.

But that aside, Xeratul, what are the goals of converting from CSV? Even clunky legacy applications like Excel can import CSV directly. Are you running in to problems with the end-of-line characters and need the unix2dos utility?
It is indeed not a so much easy thing to convert a csv file to xls, although it may be looking like.

Python,... perl or whatever whatever coding which aren't C or C++ aren't that much reliable. Sometimes you get some strange chars, and you might too have to face the unix/dos/mac format. No, really the best is to code in C/C++ for this.

Libreoffice headless is ok, but well. Terminal rocks on that way.

There is a russian website providing a converter for xls to csv. well, bit outdated and it gives issues if you have a strange char case.
 
Old 01-25-2017, 04:50 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Did you read the link provided ?. All of it ?.
unoconv exists on my system. Nice info TenTenths.
 
Old 01-26-2017, 08:48 AM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
If you want to reliably convert CSV to XLS ... uhh ... use Excel on MS-Windows!
 
Old 01-26-2017, 10:18 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by sundialsvcs View Post
If you want to reliably convert CSV to XLS ... uhh ... use Excel on MS-Windows!
This:
Code:
/usr/bin/ssconvert <csvfilename> <xlsx filename>");
..works perfectly. Libreoffice has no problems doing this headless, through a cron job for me.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert xls to csv using php ajeesh.tr Programming 1 04-26-2011 07:14 PM
Question about either csv or xls files Versatile Green Linux - Software 4 11-14-2010 07:08 AM
Perl convert csv to xls hawk__0 Programming 3 09-16-2009 09:13 AM
xls to csv or ascii Shioni Linux - Software 1 08-04-2006 05:04 AM
Parsing XLS or CSV in Perl - what and what not me_the_apprentice Programming 13 02-28-2006 03:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:12 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
Open Source Consulting | Domain Registration