The motivation behind the writing of this software was a simple one. I have often used CSV (Common Separated Value) files for work purposes, and consistantly found grep and egrep to be lacking in the ability to retrieve the information I required. Conversly I found awk to be too much. I'm sure there are many staunch awk advocates who would find that a blasphemous statement, however, while awk is perfect for many tasks, in this case I just found it to be excessive.
To this effect I started work on CsvSQL. I endeavoured to create a simple way to access specific entries in large files, based on any associative fields they might have, and to do so in a simple manner. To achieve this I decided upon using a subset of SQL as the command syntax structure, as this would already be familiar within the target user group of Systems Administrators.
CsvSQL is designed to read the contents of a CSV file into an organised hash (or associative array) of arrays. This allows it to correctly manipulate the data without corrupting it, before writing it back out disk.
In essence CsvSQL is a data manipulation program which can accurately manipulate CSV files without corrupting the data within. It is a more optimised method by which to manipulate data in a CSV file than traditional, more unwieldy tools.
A copy of the source code for this project can be found at http://www.killianfaughnan.com along with a pdf and online version of this documentation. The source for this project will also be available from CPAN in the near future.
If you optimise everything, you will always be unhappy. | ||
| --Donald Knuth | ||
| Next | ||
| Acknowledgements |