- 05.06.2011 1:30 pm - Initial created Post with Groovy, Java, Scala, awk, Ruby, Python Implementation
- 05.06.2011 4:00 pm - Add PHP implementation and update voting (now you can vote for PHP).
- 06.06.2011 4:00 pm - Add Bash implementation and update voting (now you can also vote for Bash)
Which is the best programming language for converting a simple CSV into another format?
First I blogged three Java VM based solutions written in Groovy, Java and Scala to convert a simple CSV file into another format. Rainer sends me the Java based solution, yesterday Axel Knauf sends an awk based solution, Niko sends Ruby based solution, Hendrik sends a Python based solution, Sebastian sends me a PHP implementation and Julien sends a Bash version. Now there are a Groovy, Java, Scala, awk, Ruby, Python, PHP and Bash implementation.
Now here again a complete overview of the different implementations:
The Groovy Implementation:
The Java Implementation:
The Scala Implementation:
Here the shell command and awk script:
The pure Ruby Implementation:
The Python Implementation:
The pure PHP Implementation:
The Bash Implementation:
I'm curious whether there are other implementation proposals (Clojure, Perl, PHP, …), if you have one you could send me the script via Twitter or leave a comment here…
I am also curious which implementation Groovy, Java, Scala, awk or Ruby you like and why? I have create voting here:
Thanks Rainer, Axel Knauf, Niko Dittmann, Hendrik Heimbuerger S.Barthenheier and Julien Guitton for the Java, awk, Ruby Python, PHP and Bash implementation.
Links:
- Java (Rainer) - https://gist.github.com/1006757
- awk (Axel Knauf) - https://twitter.com/#!/kopfkind/status/77288701725638656
- Ruby (Niko) - https://gist.github.com/1008877
- Python (Hendrik) - https://gist.github.com/1008881
- PHP (Sebastian) - https://gist.github.com/1008966
- Bash (Julien) - https://gist.github.com/1009420
- old blog post: Convert a CSV File with awk - http://goo.gl/U7onj
- old blog post: Convert a CSV File in Groovy, Java or Scala? - http://goo.gl/AAE17