Reputation: 937
I have an excel spreadsheet (version 1997-2003) and another nonspecific database file (a .csy file, I am assuming it can be parsed as a text file as that is what it appears to be). I need to take information from both sheets, match them up, put them on one line, and print it to a text file. I was going to use python for this as usuing the python plugins for Visual Studio 2010 alongside the xlrd package seems to be the best way I could find for excel files, and I'd just use default packages in python for the other file.
Would python be a good choice of language to both learn and program this script in? I am not familiar with scripting languages other then a little bit of VBS, so any language will be a learning experience for me.
Converting the xls to csv is not an option, there are too many excel files, and the wonky formatting of them would make fishing through the csv more difficult then using xlrd.
Upvotes: 1
Views: 3034
Reputation: 10695
I am answering your question specifically for a portion of your question, which dealt with which programming language should you learn to work with native Excel or .csv files.
Python is a very good, "Swiss Army Knife" language. It's csv module is excellent http://docs.python.org/library/csv.html.
If the Excel file is in non-ascii -- not .csv but .xls and other -- formats, start with this question. I have not used and am not familiar with these modules.
If you are never going to program on any platform but Windows, Python is still a good choice, but I will look into C# just to see what library support that language has.
I hope this helps you.
Edit: 08/29/2014 (a little over a year later)
I still feel the same way about your learning Python, but two other languages come to mind, Clojure and Perl.
If you want to learn a functional language, I believe Clojure is a good choice, though it might take more time to learn than Python. Clojure also has excellent external libraries for handling csv files.
Perl, of course, has a csv package or packages. For the web, to me, at least, Perl is a little more versatile, while running Clojure requires that you run a Java servlet (or equivalent) manager with your web manager.
Upvotes: 1
Reputation: 4493
python has a built in csv reader module http://docs.python.org/library/csv.html, and there is a 3rd party module called xlrdr: http://www.python-excel.org/
both of these libraries let you read the files into lists or dictionaries where you can do you scripting. Finally you can write as csv or even in xls format
Upvotes: 2
Reputation: 60778
Python is beginner-friendly and is good with string manipulation so it's a good choice. I have no idea how easy awk
is to learn without programming experience but I would consider that as it's more or less optimized for processing csv's.
Upvotes: -1