Converting an Excel (xls) file to a comma separated (csv) file without the GUI?

Use a perl script. Using the Spreadsheet::ParseExcel perl module from CPAN to parse the xls file followed by output as csv should work fine search.cpan.org/dist/Spreadsheet-ParseExcel You could also try using VBScript.

Use a perl script. Using the Spreadsheet::ParseExcel perl module from CPAN to parse the xls file followed by output as csv should work fine. search.cpan.org/dist/Spreadsheet-ParseExcel You could also try using VBScript.

You can use xls2csv from the catdoc package if you're on Debian/Ubuntu.

That sounds interesting, I'll check on Ubuntu. – nik Oct 14 '09 at 2:32 +1, this looks good. – nik Feb 26 '10 at 11:34 +1 Simplest answer thus far, and known to work.

– Benson Mar 16 '10 at 3:40.

Unknown (google): Disclaimer: I'm the author of xlrd (pypi.python.org/pypi/xlrd). Thanks for bringing pyXLreader to my attention; I'd never heard of it before. I may be gravely mistaken, but it appears not to be have been maintained since 2005, has an astonishing outstanding bug in the sourceforge tracker (omits fractions, all numbers presented as integers) plus a few more problems I found in a few minutes of playing with it (crashes on large files, sometimes prints "FCUKDATE" (no kidding!) when there are dates in the data, time taken is at least 6 times that of xlrd and is possibly O(N**2), memory used is at least 7 times that of xlrd).

Do you use it very much yourself?

John, I am trying to figure out how to deliver your message to our friend "unknown (google)". Thanks for your note. – nik Jun 11 '09 at 18:05.

Use one of portable Python libraries: pyxlreader.sourceforge. Net/ sourceforge. Net/projects/pyexcelerator and make extra script layer on top of it.

This is probably a good way to go too. I got the Perl solution working for me fast so I stopped on this. – nik Jun 3 '09 at 6:51 Congratulations!

:) – Denis Barmenkov Jun 3 '09 at 17:04.

Excel can be used as datasource and there are drivers available to access EXCEL as database. 1. ) Create and Open a connection to EXCEL file, which you want to convert into CSV.2.) Fire a query like "SELECT * From Sheet1", which will load all the data of Sheet1 into recordset or datatable.

3. ) Since I'm using . Net, I can hold those records on datatable and convert into CSV using following extension method.

Public static string ToCSV(this DataTable _dataTable) { StringBuilder csv = new StringBuilder(); StringWriter sw = new StringWriter(csv); int icolcount = _dataTable.Columns. Count; for (int I = 0; I Write(_dataTable. Columnsi); if (i Write(sw.

NewLine); foreach (DataRow drow in _dataTable. Rows) { for (int I = 0; I IsDBNull(drowi)) { sw. Write(drowi.ToString()); } if (i Write(sw.

NewLine); } sw.Close(); return csv.ToString(); } You can apply this approach on the platform you're working on.Thanks.

In Java world you can use apache poi. You could start from the following Groovy snippet. FileInputStream fis = new FileInputStream(filename); Workbook wb = new HSSFWorkbook(fis); Sheet sheet = wb.

GetSheetAt(0); for (Row row : sheet) { for (Cell cell : row) { doSomething(cell.toString()) } }.

Here is the C# code on how to do this: Excel to CSV in C.

Thanks. While I don't do C#, it will be useful for others who do. And, nice site there, btw.

– nik Jan 20 at 17:53.

Recommend Convert XLS: softinterface.com/Convert-XLS%5CConvert-... ‘ Convert XLS ’ is a simple to use, yet sophisticated Excel converter utility specifically designed for Excel, text and CSV (character/comma delimited) files. If you need to convert/manipulate one or thousands of files, located in one or many folders this is the tool! Conversions can be done 10-15 times faster without MS Excel.

Automate your Excel Conversion tasks by using: Built in scheduler The command line interface COM interface.

If You have Cygwin, most probablly You will have Python. If not - install python and use this script. It is much more than You need, but will convert easilly and fast.

John Machin: I cant add coment as I newbee for this forum :) I didn't use old package pyXLreader but make my post with xlrd in mind ;) I saw it month ago but not used in projects. WBR.

Iam pretty new to these forums, and it would be nice if they put the year on the time stamps(pet peeve) so I know how old the posts are. Iam going to assume they are from 2009. But a good solution in python is to use xlrd to read in your xls files.

Here is a pretty simple intro tutorial: scienceoss.com/read-excel-files-from-pyt... it isn't mine. The only problem I had was excel dates. Here is a quick fix for them: date = xlrd.

Xldate_as_tuple( int( sheet. Cell( rowNum,colNum ). Value ),workBookName.

Datemode ) than create a csv file with the inbuilt csv module,as iam a new user I can only post one hyper link. But google the csv module api. Hope that was helpfull.

You are right about the year. Thanks for the reference. – nik Jun 27 '09 at 1:53 Python xlrd was pointed out by praavDa on the day I posted this question and some days later the author John himself also added a post.

– nik Jun 27 '09 at 2:00.

VBS script and it works awesome go4expert.com/forums/showthread.php?t=18188 Set objArgs = WScript. Arguments For I = 0 to objArgs. Count - 1 FullName = objArgs(I) FileName = Left(objArgs(I), InstrRev(objArgs(I), ".") ) Set objExcel = CreateObject("Excel.

Application") set objExcelBook = objExcel.Workbooks. Open(FullName) objExcel.application. Visible=false objExcel.application.

Displayalerts=false objExcelBook. SaveAs FileName & "csv", 23 objExcel.Application. Quit objExcel.

Quit Set objExcel = Nothing set objExcelBook = Nothing Next.

From Gnumeric docs: Gnumeric is distributed along with a program called ssconvert which is the program used to convert files automatically. All of the file formats supported by Gnumeric can be used except for the Postscript and PDF file formats which operate through the printing system. I'm using it and works well.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions